Page 1 of 2

Scanning and viewing multipage TIFF files into a VFP9 form

Posted: Thu Feb 06, 2014 3:41 pm
by ANDRESC
Hello,
I would like to purchase the product but I have a doubt. I'm auditioning to deploy to an application in VFP9, need to scan multipage documents into TIFF format and view images on a form, but I can not view the form when the file is multipage TIFF. The component appears only the first page of the file. How do I view the page within other component on the form?
Thank you.

Re: Scanning and viewing multipage TIFF files into a VFP9 fo

Posted: Thu Feb 06, 2014 4:06 pm
by Alex
Hello Andrew,

Thank you for interest to our product.

VintaSoftTwain ActiveX allows to acquire images from scanner and save them to a multipage TIFF file. Also you can get any acquired image until you not cleared images buffer. VintaSoftTwain ActiveX does not allow to load images from TIFF file. Have I answered to your question?

Best regards, Alexander

Re: Scanning and viewing multipage TIFF files into a VFP9 fo

Posted: Thu Feb 06, 2014 5:19 pm
by ANDRESC
But these acquired images can not be viewed on a form? Available for example in visual foxpro I can scan the document into tiff multipage format but the display appears only 1 page.
Image1 object in the example is not possible to visualize the other pages?

Re: Scanning and viewing multipage TIFF files into a VFP9 fo

Posted: Thu Feb 06, 2014 8:32 pm
by Alex
Hello Andrew,

What code do you use?

Have you seen our example for Visual Foxpro 9.0 here:
http://www.vintasoft.com/vstwain-examples.html ?

Best regards, Alexander

Re: Scanning and viewing multipage TIFF files into a VFP9 fo

Posted: Thu Feb 06, 2014 8:59 pm
by ANDRESC
Hello Alexander,

I am using this example.
I changed the code thisform.BAcquireDoc.click object to:

Code: Select all

IF index = 0 THEN 
    MESSAGEBOX ('You must first add a record!') 
ELSE 
    this.Parent.VSTwain1.StartDevice 
    IF this.Parent.VSTwain1.SelectSource = 1 THEN 
        this.Parent.VSTwain1.showUI = 1 
        this.Parent.VSTwain1.disableAfterAcquire = 0 
        this.Parent.VSTwain1.maxImages = 1 
        this.Parent.vSTwain1.autoCleanBuffer =. T. 
        this.Parent.vsTwain1.tiffMultiPage =. T. 
        this.Parent.vstwain1.tiffCompression = 10 
        this.Parent.VSTwain1.Acquire 
    ENDIF 
ENDIF 
Only the first page of the document appears in object Image1.

how can I view the other pages?

Re: Scanning and viewing multipage TIFF files into a VFP9 fo

Posted: Fri Feb 07, 2014 10:34 am
by Alex
Hello Andrew,

Your code snippet shows how you initialize the scanning process. I need to see the handler of PostScan event where you preview image.

Best regards, Alexander

Re: Scanning and viewing multipage TIFF files into a VFP9 fo

Posted: Fri Feb 07, 2014 3:45 pm
by ANDRESC
The code PostScan event is:

Code: Select all

*** ActiveX Control Event *** 
LPARAMETERS flag 
IF this.errorCode <> 0 THEN 
    MESSAGEBOX (this.errorString) 
ELSE 
    IF this.numImages <> 0 THEN 
        localPath = JUSTPATH ​​(DBF ('A')) + "\" 
        fName = localPath ALLTRIM + (str (index)) + '. tif' 
        IF this.SaveImage (0, fName) = 0 THEN 
            this.Parent.ORDER_DOC1.Value ='' 
            MESSAGEBOX (this.errorString) 
        ELSE 
            this.Parent.ORDER_DOC1.Value = fName 
            this.Parent.Image1.Picture = fName 
        ENDIF 
    ENDIF 
ENDIF

Re: Scanning and viewing multipage TIFF files into a VFP9 fo

Posted: Fri Feb 07, 2014 5:31 pm
by ANDRESC
Is there any example of VintaSoftTwain.NET SDK for VFP9?

Re: Scanning and viewing multipage TIFF files into a VFP9 fo

Posted: Fri Feb 07, 2014 8:39 pm
by Alex
Is there any example of VintaSoftTwain.NET SDK for VFP9?
Visual Foxpro 9 does not support .NET components therefore you cannot use VintaSoftTwain.NET SDK in Visual Foxpro 9.

Best regards, Alexander

Re: Scanning and viewing multipage TIFF files into a VFP9 fo

Posted: Fri Feb 07, 2014 8:48 pm
by Alex
Your handler of PostScan event shows each acquired image in picture box, after scan the last acquired image will be visible.

VintaSoftTwain ActiveX places each acquired image in the internal image buffer. Size of internal image buffer can be set with the MaxImages property. Number of images in internal image buffer can be get with the NumImages property. Image can be retrieved from buffer with the GetImage, GetImageAsHBitmap, ... methods.

I think you need store all acquired images in internal image buffer and retrieve necessary image for preview when this is necessary.

Best regards, Alexander