Scanning Area / PageSize

Questions, comments and suggestions concerning VintaSoft Twain ActiveX.

Moderator: Alex

Post Reply
meimad
Posts: 2
Joined: Sun Oct 12, 2014 5:38 pm

Scanning Area / PageSize

Post by meimad » Sun Oct 12, 2014 5:42 pm

Hi

I'm Using ms access 2007 and I want to set the page width and height (same as scanning area using the ui)
my scanner is fi-6130. The width is 170mm and the height is 70mm.

I'm using the following code (from the faq)

Code: Select all

VintaSoftTwain1.StartDevice
If VintaSoftTwain1.SelectSource() = 1 Then         ' select the device
    VintaSoftTwain1.ShowUI = False                 ' disable UI
    VintaSoftTwain1.DisableAfterAcquire = True
    VintaSoftTwain1.MaxImages = 1
    VintaSoftTwain1.AutoCleanBuffer = True
    VintaSoftTwain1.TiffMultiPage = True           ' multi page TIFF file
    VintaSoftTwain1.TiffCompression = 10           ' auto detect best
                                            ' compression algorithm
    If VintaSoftTwain1.OpenDataSource() = 1 Then
        VintaSoftTwain1.UnitOfMeasure = 1          ' centimeters
        VintaSoftTwain1.PixelType = 2              ' rgb
        VintaSoftTwain1.Resolution = 200           ' 200 dpi
        If VintaSoftTwain1.DUPLEX <> 0 Then
            VintaSoftTwain1.DuplexEnabled = True   ' enable duplex
        End If
        If VintaSoftTwain1.FeederPresent = 1 Then
            VintaSoftTwain1.XferCount = -1
            VintaSoftTwain1.FeederEnabled = True
            VintaSoftTwain1.AutoFeed = True
            If VintaSoftTwain1.FeederLoaded = 1 Then
                VintaSoftTwain1.Acquire
            End If
        End If
        End If
    End If
End If
Thanks

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

Re: Scanning Area / PageSize

Post by Alex » Wed Oct 15, 2014 11:08 am

Hello,

You can set page size using the VSTwain.PageSize property if you want to use predefined page size. List of supported page sizes can be get using the VSTwain.GetPageSizes method.

You can set page size using the VSTwain.SetImageLayout method if you want to set custom image size.

I think you have problems because you are using centimeters as unit of measure. Please use inches as unit of measure as shown in the code snippet below:

Code: Select all

VintaSoftTwain1.StartDevice
If VintaSoftTwain1.SelectSource() = 1 Then          ' select the device
    VintaSoftTwain1.ShowUI = False                      ' disable UI
    VintaSoftTwain1.DisableAfterAcquire = True
    VintaSoftTwain1.MaxImages = 1
    VintaSoftTwain1.AutoCleanBuffer = True

    If VintaSoftTwain1.OpenDataSource() = 1 Then
        VintaSoftTwain1.PixelType = 2                     ' rgb
        VintaSoftTwain1.UnitOfMeasure = 0              ' inches
        VintaSoftTwain1.Resolution = 200                 ' 200 dpi (dots-per-inch)
        VintaSoftTwain1.SetImageLayout(1,1,5,5)    ' image layout is specified in inches

        VintaSoftTwain1.Acquire
    End If
End If
Best regards, Alexander

meimad
Posts: 2
Joined: Sun Oct 12, 2014 5:38 pm

Re: Scanning Area / PageSize

Post by meimad » Sun Nov 09, 2014 12:53 pm

Thanks

I'll try it

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest