3
votes

I have a business card scanner I'm using WIA 2.0 to interface with. I'm trying to set everything up in code so that I don't have to pop any dialog boxes. The issue I'm having has to do with setting the scanning page size. The scanner is about 4" wide but I can't get it to scan the right-most inch or so of it's bed. I would set the PAGE_SIZE property but I don't see that property when iterating through all the properties WIA has for that scanner (Device or Item properties).

If I pop a dialog box up (ShowSelectDialog) to select the size everything seems to work fine. I've compared the properties on the Item and Device before and after that dialog and the only properties I see changing are read-only properties according to MSDN. (Horizontal and Vertical size, extent, starting position)

Any ideas on how else I could modify the page size?

1
I'm having the same problem - I cannot set the horizontal or vertical page size properties, and in fact can only modify them using the CommonDialog when I've selected the source to be the Feeder as opposed to the flatbed on an FI-6230 Fujitsu scanner.flatline

1 Answers

0
votes

You can try setting the values on the Item property e.g

double _width = 2; //two inches
double _height = 2; //two inches

 dynamic item = device.Items[1]; // get the first item

 int dpi = 150;

                    item.Properties["6146"].Value = 2; //greyscale
                    item.Properties["6147"].Value = dpi;
                    item.Properties["6148"].Value = dpi;
                    item.Properties["6151"].Value = (int)(dpi * _width);
                    item.Properties["6152"].Value = (int)(dpi * _height);

This worked for me when I needed to scan an A3 sheet.