Multiple Pages with WIA

Discussions about TWAIN & WIA scanning in GdPicture.NET using GdPictureImaging.
Post Reply
mmorvant
Posts: 2
Joined: Fri Aug 11, 2023 1:10 pm

Multiple Pages with WIA

Post by mmorvant » Fri Aug 11, 2023 1:41 pm

I am using GdPicture.NET.14 (14.1.0.166). I cannot upgrade any further at this time due to the software already deployed. I have an x64 (anyCPU) application that requires a scanning component. Due to the rarity of 64b TWAIN drivers, I am using WIA. The application benefits from running as 64b, so I do not wish to change it to x86 to use TWAIN.

I am having trouble getting multiple pages to scan. My custom code and the sample code for WIA exhibit the same behavior. Below is the code in question (All pages -> Multipage TIFF).

Code: Select all

        private void Command1_Click(System.Object eventSender, System.EventArgs eventArgs) 
        { 
            int nImageCount = 0; 
            int ImageID = 0; 
            int MultiPageID = 0; 
            
            if (OpenSelectedSource()) 
            { 
                nImageCount = 0;
                if (chkHideUI.CheckState == CheckState.Unchecked) 
                { 
                    oGdPictureImaging.WiaShowSetupDialogSource(); 
                } 
                oGdPictureImaging.WiaSelectFeeder(true); 
                
                   do 
                { 
                    ImageID = oGdPictureImaging.WiaAcquireToGdPictureImage(); 
                    if (ImageID != 0) 
                    { 
                        nImageCount = nImageCount + 1; 
                        ApplyImageFilters(ImageID); 
                        if (chkPreview.CheckState == CheckState.Checked)
                        { 
                            DisplayImage(ImageID); 
                        } 
                         if (nImageCount == 1) 
                        { 
                            MultiPageID = ImageID; 
                             oGdPictureImaging.TiffSaveAsMultiPageFile(MultiPageID, @"multipage.tif", TiffCompression.TiffCompressionCCITT4); 
                        } 
                        else 
                        { 
                            oGdPictureImaging.TiffAddToMultiPageFile(MultiPageID, ImageID); 
                            oGdPictureImaging.ReleaseGdPictureImage(ImageID); 
                        } 
                    } 
                } 
                while (oGdPictureImaging.WiaGetLastError() == WiaStatus.WIA_OK); 

                oGdPictureImaging.TiffCloseMultiPageFile(MultiPageID); 
                MessageBox.Show("Done. WIA status: " + oGdPictureImaging.WiaGetLastError().ToString()); 
                oGdPictureImaging.WiaCloseSource(); 
            } 
        
I have seen some variants of this problem on the board for TWAIN, but I didn't notice one that fit my situation exactly. I apologize if there is one there that I missed.

If 1 page is in the feeder, the program executes as expected with no issue with or without Duplex. If 2 pages are in the feeder, it scans the first page and then the second but hangs after. I can't break into the loop or detect any error. After killing the application, I have to unplug the scanner to get it to reset. This issue occurs with or with Duplex. I do get the same behavior using the PDF option in the sample. I have tried to change the loop to detect if the feeder has any pages, but as others have noted, that always returns true.

I saw there is a page dedicated to troubleshooting TWAIN issues, but I didn't see one for WIA. Does such a troubleshooting guide exist? Regardless, any help or tips would be appreciated.

Matthew

P.S. The scanner that I am testing with is a Fujitsu fi-8170 with current drivers.

Hugo
Posts: 227
Joined: Tue Dec 18, 2018 10:09 am

Re: Multiple Pages with WIA

Post by Hugo » Fri Aug 11, 2023 3:19 pm

Hi Matthew,

Thanks for your detailed explanation of the issue you are seeing on your end.

The first thing would be to test this with the latest GdPicture version and your scanner's latest drivers. However you mention to be stuck on V14.1.166 which is quite outdated at this time. This is a restriction. You also mention to have the latest drivers for your device installed. Please make sure you download this from your scanners website as automatically searching for updates in device manager may not always find the latest driver for your device.

I suppose from a hardware standpoint that there are no paperjams. Have you tried doing this before and it worked? Or has this always been the case ever since you got the scanner?

Unfortunately I cannot provide accurate support for such an issue as you are using an older GdPicture version. Furthermore, this is likely to be an issue with your specific scanner and we would be unable to replicate this due to not having the exact same one on our side.

I'd suggest double checking what I mentioned above to see if you have missed something on your end.
Unfortunately if the issue persist I'd recommend testing in different environments or with different devices to find out more about why this is happening and if this is device specific.

Regards,
Hugo Cudd
Technical Support

mmorvant
Posts: 2
Joined: Fri Aug 11, 2023 1:10 pm

Re: Multiple Pages with WIA

Post by mmorvant » Sun Aug 13, 2023 11:45 am

Hugo,

Thanks for your reply. I did install the latest version of the GdPicture SDK, and the problem also exists with the included WIA sample. The driver for the scanner was downloaded from Fujitsu's website (It had an updated date of 8/2/2023). I tried an older scanner Fujitsu fi-7160, and the application worked as expected. I will contact Fujitsu to investigate this matter further.

Matthew
Hugo wrote:
Fri Aug 11, 2023 3:19 pm
Hi Matthew,

Thanks for your detailed explanation of the issue you are seeing on your end.

The first thing would be to test this with the latest GdPicture version and your scanner's latest drivers. However you mention to be stuck on V14.1.166 which is quite outdated at this time. This is a restriction. You also mention to have the latest drivers for your device installed. Please make sure you download this from your scanners website as automatically searching for updates in device manager may not always find the latest driver for your device.

I suppose from a hardware standpoint that there are no paperjams. Have you tried doing this before and it worked? Or has this always been the case ever since you got the scanner?

Unfortunately I cannot provide accurate support for such an issue as you are using an older GdPicture version. Furthermore, this is likely to be an issue with your specific scanner and we would be unable to replicate this due to not having the exact same one on our side.

I'd suggest double checking what I mentioned above to see if you have missed something on your end.
Unfortunately if the issue persist I'd recommend testing in different environments or with different devices to find out more about why this is happening and if this is device specific.

Regards,
Hugo Cudd
Technical Support

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest