Open JohnDoe2193 opened 1 month ago
WIA_IPS_PAGE_SIZE can be set to WIA_PAGE_AUTO, though I don't have those constants predefined in NAPS2.Wia right now so you'd have to define them yourself.
documentSource.SetProperty(3097, 100);
Whether it works or not depends on your scanner.
Thanks, the scanner I use is Xerox Duplex Combo Scanner and when I tried what you suggested following exception is thrown:
"Value does not fall within the expected range."
I have a Windows Forms application targeting .Net Framework 4.7.2. The function of application is to scan documents using document scanner (flatbed or feeder), display documents on the screen and save the result to PDF. Note that the stack of documents placed in the feeder may contain a mix of Letter and Legal sized pages.
I use NAPS2.Wia component for scanning. If I don't explicitly specify paper size everything works except when Legal size paper is put in the feeder it is treated as a Letter sized paper and bottom of the page is cutoff.
I did find a solution but it is a bit of kludge:
Then if the paper source is a feeder I additionally execute this:
Is there a better way to achieve the same result (I don't really like specifying paper height like that)? Something like paperSize=Auto