GdTwain IIS

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

GdTwain IIS

Post by jsamorozco » Sat Jan 30, 2010 1:04 am

I’m trying implement a web solution, where users, can scan documents, and it’s on IIS Server,
We have purchased license for GdTwain Pro SDk,
but i have not found the way for implement the object activex with gdtwain Pro, do you have an example about this?
i found an example with gdpicture but my license number does not work
thanks

i'm trying with code in javascript like this

Code: Select all

function TwainScan(calidad, color, dpi , redcalidad, duplex, ho, cu, pu, pt, key) {
                    imagesCounter = 1;
                    var nImageId = 0;
                    var rt = “imgs/”;
                    
                    MyImaging.SetLicenseNumber("XXXXXXXXXXXXXXXXXXXXXXXX");                
                    MyImaging.TwainSelectSource();
                    MyImaging.TwainOpenDefaultSource();
                    MyImaging.TwainSetCurrentPixelType(color);
                    MyImaging.TwainSetHideUI(true);
                    MyImaging.TwainSetCurrentCompression(redcalidad);
                    MyImaging.TwainSetCurrentResolution(dpi);                    
                    MyImaging.TwainSetAutoFeed(true);                    
                    MyImaging.TwainEnableDuplex(false);
 
                    do {
                       var archivo = rt + "_" + imagesCounter;
                        nImageId = MyImaging.CreateImageFromTwain();
                        MyImaging.SaveAsJPEG("c:\\file.jpg");
                        MyImaging.UploadFileToFTP("c:\\file.jpg", ho,  archivo + ".jpg", cu, pu, pt);
                        imagesCounter++;
                    } while (MyImaging.CreateImageFromTwain(0) != 0)
 
                    MyImaging.TwainCloseSource();
                }
and the object in html :

Code: Select all

<object id="MyImaging" type="application/x-oleobject" classid="CLSID:1E9EFC03-BF47-4479-8374-7F5D610FF60D" codebase="../bin/gdTwain2.cab#Version=2,7,6,0">
        <param name="LicenseKey" value="XXXXXXXXXXXXXXXXXXXXXXXXX">
</object>

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

Re: GdTwain IIS

Post by Loïc » Sat Jan 30, 2010 10:36 am

Hi There,

If you are using GdTwain Pro you are using the bad reference for cab & object CLSID.

Object CLSID can be found on the first page of the reference guide. Also, I suggest you to use the "Safe" edition for webpage usage.

Here the good HTML object declaration fro GdTwain Pro Safe edition.

Code: Select all

<OBJECT ID="MyTwain"
             TYPE="application/x-oleobject" 
             CLASSID="CLSID:602243A1-ECA9-421E-9CF6-D23815BEEC91" 
             WIDTH=0 
             HEIGHT=0 
             CODEBASE="https://www.gdpicture.com/pub/gdtwainpro2s.cab#Version=2,7,6,0">
             <param name="LicenseKey" value="Your_License_KEY_Here">
</OBJECT>
Hope this helps !

With best regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests