Forcing A4 size, but scanning A5 leads to black background

Discussions about TWAIN scanning in GdPicture.NET using GdPictureImaging.
Post Reply
Posts: 19
Joined: Wed Oct 03, 2012 7:52 am

Forcing A4 size, but scanning A5 leads to black background

Post by acl » Mon Apr 14, 2014 12:57 pm

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

imageID = imagingApi.TwainAcquireToGdPictureImage(_windowHandle)
pdfApi.AddImageFromGdPictureImage(imageID, False, True)

Posts: 352
Joined: Tue Sep 27, 2011 11:47 am

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

Post by SamiKharma » Mon Apr 14, 2014 2:03 pm


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.


Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests