Page 1 of 1

Forcing A4 size, but scanning A5 leads to black background

Posted: Mon Apr 14, 2014 12:57 pm
by acl
We have a scenario in which the user forces paper size A4 when scanning, but the paper he scans is actually smaller (A5 for instance). The result is an A4 page, with one half being the scanned A5 document, and the other half being completely black.

This is all fine and well, but it's a terrible waste of ink when printing. It would be better if the black part were white instead. Is it possible to influence this somehow? Note: the output has to be an A4 PDF, not A5.

I'm roughly using the following code:

Code: Select all

imageApi.TwainSetAutomaticBorderDetection(False)
imageApi.TwainSetPaperSize(GdPicture9.TwainPaperSize.A4)
imageID = imagingApi.TwainAcquireToGdPictureImage(_windowHandle)
pdfApi.AddImageFromGdPictureImage(imageID, False, True)

Re: Forcing A4 size, but scanning A5 leads to black backgrou

Posted: Mon Apr 14, 2014 2:03 pm
by SamiKharma
Hi,

Unfortunately no, some scanners scan the empty space as black while others do so as white. There is no way of controlling that since that it how they are manufactured.
You can change the color after scanning using the SwapColor method, but you would have to calculate the region of the color to apply that function yourself.

Best,
Sami