Detect Pageorientation

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Moderator: Alex

Post Reply
zweitaktfan
Posts: 2
Joined: Fri Dec 12, 2014 10:46 am

Detect Pageorientation

Post by zweitaktfan »

Hi!

I'm using Fujitsu FI5750C and 6770A scanners, both scanners have A3-ADF, where the user can load some A4.
All the scanned pages from ADF get in one tif-file, after scanning i detect barcodes and split the files.
How can i detect, if the user has loaded the A4-paper into the ADF PORTRAIT or LANDSCAPE ?

Greetings,
Uli
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: Detect Pageorientation

Post by Alex »

Hi Uli,

TWAIN specification allows to specify page orientation before scanning but it does not allow to get information about page orientation of acquired image.

TWAIN specification allows to extend functionality of driver by creating the custom capabilities. You need contact Fujitsu support for information about custom capabilites of your scanners.

Also you can use the software solution for detecting page orientation. For example, VintaSoftDocCleanup.NET Plug-in allows to detect page orientation of document images.

Best regards, Alexander
zweitaktfan
Posts: 2
Joined: Fri Dec 12, 2014 10:46 am

Re: Detect Pageorientation

Post by zweitaktfan »

Hi Alexander,
how can i detect the pagesize? Is there autosize-param?
is this correct?

Code: Select all

DeviceCapability Pageautosize = device.Capabilities.Find(DeviceCapabilityId.IAutoSize);
            if (Pageautosize == null)
                MessageBox.Show("Kein automatisches Erkennen der Seitengröße möglich, der Scanner unterstützt das nicht.");
            else
                device.PageAutoSize = PageAutoSize.Auto;
How can i detect blank pages? i use this:

Code: Select all

            DeviceCapability autoDiscardBlankPagesCap = device.Capabilities.Find(DeviceCapabilityId.IAutoDiscardBlankPages);
            if (autoDiscardBlankPagesCap == null)
                MessageBox.Show("Kein automatisches Erkennen von leeren Seiten möglich, der Scanner unterstützt das nicht.");
            else
                autoDiscardBlankPagesCap.SetValue(true);
If i run this code, no messagebox is shown.

Additionally, in imageacquired-event i use this in hope to get cleaner images for blank-page-detection:

Code: Select all

e.Image.Despeckle(8, 25, 30, 400);
            e.Image.Deskew(BorderColor.AutoDetect, 5, 5);
            e.Image.DetectBorder(5);
But:
if (!e.Image.IsBlank(0.02F))
returns always true, none of my images are blank.

Please help!
Thx,
Uli
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: Detect Pageorientation

Post by Alex »

Hi Uli,

Please read this how to:
http://www.vintasoft.com/docs/vstwain-d ... nning.html

and let me know if you will have any question or problem.

Best regards, Alexander
Post Reply