C# WIA with Automatic Document Feeder (ADF) retuns only one page on certain scanners

前端 未结 3 1122
轮回少年
轮回少年 2020-12-18 07:55

I have a HP Scanjet 7000 (duplex & ADF scanner) and a HP Scanjet 5500c (only ADF) and a scanner program I\'m developing which uses WIA 2.0 on Windows 7.

The prob

3条回答
  •  北海茫月
    2020-12-18 08:40

    After alot of trial and error I stumbled upon a solution which worked for reasons I'm not quite sure of. It seems like the ShowTransfer() method was unable to convert the page to .png or .tiff WHILE scanning. Setting the format to JPEG or BMP actually solved the issue for me:

    image = (ImageFile)scanDialog.ShowTransfer(item, wiaFormatJPEG, false);
    

    I think I saw somewhere on the web that this method actually returns BMP regardless of the format specified. Might be that converting the image to png or tiff is too heavy as opposed to using bmp or jpeg.

    On a sidenote, I'm setting the property setting: 3088 to 0x005 (adf AND duplex mode).

提交回复
热议问题