Scanning and viewing multipage TIFF files into a VFP9 form

Questions, comments and suggestions concerning VintaSoft Twain ActiveX.

Moderator: Alex

ANDRESC
Posts: 6
Joined: Thu Feb 06, 2014 3:21 pm

Scanning and viewing multipage TIFF files into a VFP9 form

Post by ANDRESC » Thu Feb 06, 2014 3:41 pm

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.

Alex
Site Admin
Posts: 1462
Joined: Thu Jul 10, 2008 2:21 pm

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

Post by Alex » Thu Feb 06, 2014 4:06 pm

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

ANDRESC
Posts: 6
Joined: Thu Feb 06, 2014 3:21 pm

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

Post by ANDRESC » Thu Feb 06, 2014 5:19 pm

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?

Alex
Site Admin
Posts: 1462
Joined: Thu Jul 10, 2008 2:21 pm

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

Post by Alex » Thu Feb 06, 2014 8:32 pm

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

ANDRESC
Posts: 6
Joined: Thu Feb 06, 2014 3:21 pm

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

Post by ANDRESC » Thu Feb 06, 2014 8:59 pm

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?

Alex
Site Admin
Posts: 1462
Joined: Thu Jul 10, 2008 2:21 pm

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

Post by Alex » Fri Feb 07, 2014 10:34 am

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

ANDRESC
Posts: 6
Joined: Thu Feb 06, 2014 3:21 pm

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

Post by ANDRESC » Fri Feb 07, 2014 3:45 pm

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

ANDRESC
Posts: 6
Joined: Thu Feb 06, 2014 3:21 pm

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

Post by ANDRESC » Fri Feb 07, 2014 5:31 pm

Is there any example of VintaSoftTwain.NET SDK for VFP9?

Alex
Site Admin
Posts: 1462
Joined: Thu Jul 10, 2008 2:21 pm

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

Post by Alex » Fri Feb 07, 2014 8:39 pm

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

Alex
Site Admin
Posts: 1462
Joined: Thu Jul 10, 2008 2:21 pm

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

Post by Alex » Fri Feb 07, 2014 8:48 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests