We help IT Professionals succeed at work.

C# Application to scan multiple pages via document feeder (WIA)

1,174 Views
Last Modified: 2019-02-22
I'm trying to use WIA to scan multiple pages through the document feeder. I can access the scanner, connect to the scanner, and even actually scan but it doesn't quite work as expected. If I have more than one page in the document feeder the scanner scans all pages at once and then creates a single image that is only the first page. I'm following the examples from here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/edaa6de7-e372-4b57-89a5-dd74c5f30983/adf-scanning-using-wia-only-one-image-saved?forum=csharpgeneral

There seems to be some reference to other people experiencing the same problem and a link to a supposed solution here: https://support.microsoft.com/en-us/help/261820

Unfortunately, that link is dead so I'm hoping someone here might have a clue. How do I get the scanner to actually scan multiple pages rather than feed them all but only scan the first one?
Comment
Watch Question

KimputerIT Manager
CERTIFIED EXPERT

Commented:
You probably know about NAPS2? Use that first, see if it scans correctly. If it does, you already have the code, and re-inventing the wheel seems pointless. Source code here: https://github.com/cyanfish/naps2
CERTIFIED EXPERT

Commented:
Others have had that problem before, multiple pages with adf
and
scan multiple images from scanners with an auto document feeder
the bottom line is that instead of setting device properties and then setting item properties , you need to set item first
if you call WiaDev.Items[1] apprently it erases the item from memory so you cant call it again
so you must store it in a variable THEN the properties must be set.
scan
check for more pages and loop until no more

check both codes its a little different approach from each one but the bottomline is the same
Russ SuterSenior Software Developer
CERTIFIED EXPERT

Author

Commented:
@arana

I have been down that road already and addressed the issue. The current oddity is with an HP LaserJet Pro MFP M426f. When I connect via USB it seems to scan and print all pages from the ADF as well as a single page from the flatbed. However, when I connect to the same printer via Ethernet and use the exact same code the ADF feeds all pages but only scans the first one.

From the additional research I've been doing it appears that WIA may not be the solution here. I may need to look into using TWAIN instead.
Senior Software Developer
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.