Home | About us | Overview | Softwares - Downloads | Evaluate | Order | Support | old forums | Contact | F.A.Q. | Documentations | Search | Sitemap

Multipage Tiff Error

Support for GdPicture Light Imaging Toolkit and GdPicture Pro Imaging ActiveX/SDK.

Multipage Tiff Error

Postby mfunai on Tue Sep 16, 2008 12:06 am

I'm now getting an error when creating multipage tiffs, on each page. It says:

SetcapOneValue: Attempt to set capability value out of state 4.
RC: TWRC_FAILURE
CC: TWCC_OPERATIONERROR
State:6

Can you help me out on this, I have no idea what it means.
mfunai
 
Posts: 9
Joined: Tue Aug 05, 2008 12:04 am

Re: Multipage Tiff Error

Postby Loïc on Tue Sep 16, 2008 10:59 am

Hi,

This is not a multipage tiff problem.

You are probably trying to change your scanner configuration during an acquisition process which is not possible thought the TWAIN protocol. Check in your code you are not calling twain function between CreateImageFromTwain() and end of scanning.

Best regards,

Loïc Carrère
User avatar
Loïc
Site Admin
 
Posts: 1350
Joined: Tue Oct 17, 2006 11:48 pm
Location: France

Re: Multipage Tiff Error

Postby mfunai on Tue Sep 16, 2008 11:27 pm

I don't think so. I'm trying to write to 2 files, one with blank and with nonblank images. Here is my code...

Code: Select all
If Imaging1.TwainOpenDefaultSource() Then
                nImageCount = 0
                nImageCountBlank = 0

                InitScanConfig()

                Imaging1.TwainEnableDuplex(True)
                Imaging1.TwainSetAutoFeed(True) 'Set AutoFeed Enabled
                Imaging1.TwainSetAutoScan(True) 'To  achieve the maximum scanning rate

                Imaging1.TwainSetCurrentResolution(200)
                Imaging1.TwainSetCurrentPixelType(GdPicturePro5.TwainPixelType.TWPT_BW) 'BW
                Imaging1.TwainSetCurrentBitDepth(1) ' 1 bpp

                While Imaging1.CreateImageFromTwain(Me.Handle.ToInt32) <> 0
                    nImageID = Imaging1.GetNativeImage
                    nImageCount = nImageCount + 1
                    Call ApplyImageFilters(nImageID)
                    If chkPreview.CheckState = 1 Then Call DisplayNativeImage()
                    Dim success = Imaging1.TwainSetAutomaticDiscardBlankPages(True)
                    If Imaging1.IsBlank(99) = False Then
                        If nImageCount = 1 Then
                            Call Imaging1.TiffSaveAsNativeMultiPage(My.Application.Info.DirectoryPath & "\multipage.tif", 4)
                        Else
                            Imaging1.TiffAddToNativeMultiPage(nImageID)
                            Imaging1.CloseImage(nImageID)
                        End If
                    Else
                        nImageCountBlank = nImageCountBlank + 1
                        If nImageCountBlank = 1 Then
                            Imaging2.SetNativeImage(nImageID)
                            Call Imaging2.TiffSaveAsNativeMultiPage(My.Application.Info.DirectoryPath & "\multipageall.tif", 4)
                        Else
                            Imaging2.TiffAddToNativeMultiPage(nImageID)
                            Imaging2.CloseImage(nImageID)
                        End If
                    End If
                End While

                Dim nMultiPageImageIN As Long
                nMultiPageImageIN = Imaging1.TiffCreateMultiPageFromFile("multipage.tif")
                Dim pages = Imaging1.TiffGetPageCount(nMultiPageImageIN)

                Dim TiffFile = My.Application.Info.DirectoryPath & "\multipage.tif"
                Dim s As String = Read1DProZones(TiffFile, CType(pages, Integer), TiffFile)

                Imaging1.TiffCloseNativeMultiPage()
                Imaging1.TwainCloseSource()
                Imaging2.TiffCloseNativeMultiPage()
                'MsgBox("Done !")
            Else
                MsgBox("can't open default source, twain state is: " & Trim(Str(Imaging1.TwainGetState)))
            End If
mfunai
 
Posts: 9
Joined: Tue Aug 05, 2008 12:04 am

Re: Multipage Tiff Error

Postby mfunai on Tue Sep 23, 2008 12:15 am

I still don't see anything wrong with my code.
mfunai
 
Posts: 9
Joined: Tue Aug 05, 2008 12:04 am

Re: Multipage Tiff Error

Postby Loïc on Tue Sep 23, 2008 12:11 pm

Hi,

This line:

Code: Select all
Dim success = Imaging1.TwainSetAutomaticDiscardBlankPages(True)


Should be placed before this one:

Code: Select all
While Imaging1.CreateImageFromTwain(Me.Handle.ToInt32) <> 0


Best regards,

Loïc Carrère
User avatar
Loïc
Site Admin
 
Posts: 1350
Joined: Tue Oct 17, 2006 11:48 pm
Location: France


Return to GdPicture [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 0 guests