Duplex gdpicturepro5 javascript

Discussions about TWAIN & WIA scanning in GdPicture.NET using GdPictureImaging.
Post Reply
jsamorozco
Posts: 3
Joined: Wed Jan 13, 2010 8:25 pm

Duplex gdpicturepro5 javascript

Post by jsamorozco » Wed Jul 14, 2010 4:47 am

Good day, I have an application in IIS, asp net work in c #, use the activex gdpicturepro5.cab # Version = 5,3,0,0, with javascript, I really need to use duplex mode, scanning, each image I keep it in unity and sent via ftp to the server, when I use the property, TwainEnableDuplex not work, I need to send the scanned document by both sides to ftp, each side in jpg format
What am I doing wrong?
in the rest works perfectly if I do not use duplex mode.

code in my script is:

Code: Select all

 function TwainScan(dp) {
            imagesCounter = 1;
            var nImageId = 0;
            var rt = "Server"
            var key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXX";
            MyImaging.SetLicenseNumber(key);

            if (MyImaging.TwainSelectSource()) {
                MyImaging.TwainOpenDefaultSource();
                MyImaging.TwainSetHideUI(true);
 
               if (dp == "1") {
                    MyImaging.TwainEnableDuplex(true);
                }
                else
                { MyImaging.TwainEnableDuplex(false); }
                
                
                do {
                    var archivo = rt + "/ArchivoPrueba_" + imagesCounter + ".jpg";

                    nImageId = MyImaging.CreateImageFromTwain();
                    MyImaging.SetNativeImage(nImageId);
                    MyImaging.SaveAsJPEG("C:\\TmpArchivos\\archivo.jpg");

                    MyImaging.UploadFileToFTP("C:\\TmpArchivos\\archivo.jpg", "serverftp", archivo , "anonymous", "anonymous", 21);
                    imagesCounter++;

                } while (MyImaging.CreateImageFromTwain(0) != 0)
                

                MyImaging.TwainCloseSource();
            }
}


thanks

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Duplex gdpicturepro5 javascript

Post by Loïc » Wed Jul 14, 2010 9:03 am

Hi,

You should replace

Code: Select all

 while (MyImaging.CreateImageFromTwain(0) != 0)
by

Code: Select all

 while (nImageId != 0)
Hope this helps !

Loïc

jsamorozco
Posts: 3
Joined: Wed Jan 13, 2010 8:25 pm

Re: Duplex gdpicturepro5 javascript

Post by jsamorozco » Wed Jul 14, 2010 4:47 pm

ready, that solved my problem, thank you very much!!!

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Duplex gdpicturepro5 javascript

Post by Loïc » Wed Jul 14, 2010 4:54 pm

Great ! monster

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest