TWAIN Working Group

Newsletter Signup
Donate
Help keep TWAIN free
  • About TWAIN
    • What’s New?
    • News
    • Events
    • Membership
    • Consider a Donation
    • Contact Us
  • Why TWAIN?
  • Developers
    • Driver Developer
    • Application Developer
    • TWAIN Features
    • Specification & Tools
    • Self Certification Process
  • Support Forums
  • Scanner End-User
  • Find Certified Drivers
    • Facebook
    • LinkedIn
    • Vimeo

Re: Re: Scanning images using JTwain API

Forums › TWAIN Classic › Scanning images using JTwain API › Re: Re: Scanning images using JTwain API

January 26, 2009 at 8:06 am #24782
fct
Participant
  • Topics - 0
  • Replies - 24
  • Total Posts - 24

@Priyanka Singhal wrote:

I am using JTwain API for implementing Scanning functionality in our project.I need to know how would I add a capability of selective scanning of pages.For our Scan Documents business case,the user can specify on the applet screen what particular page nos have to be scanned.
If page numbers or ranges are specified for scanning, then the scanning will be performed as follows:

“2,4,7” – scan the specified pages
“3-5” – scan the range
“5-“ – scan from page 5 to end
“b-4-” scan last 4 pages

Since you’re using a scanner with a feeder (or so I understand from your message) what’s going to happen is that it will actually feed all the pages in the feeder before you can select the ones you want and discard the others (specially if you don’t know the number of pages beforehand in the b-4- case).

So you could:

1) just scan every page to files in disk sorted by number of page (scan001.jpg, scan002.jpg, etc.) and then delete those not selected.

2) keep a counter and increase it after every successful scan of a single page, so you can discard pages on the fly if they don’t belong to the selection. This implementation will be more complicated in the b-4- case when you don’t know how many pages are to be scanned.

3) There are also the capabilities CAP_CLEARPAGE, CAP_FEEDPAGE, CAP_AUTOFEED, etc. which you can use to eject pages instead of actually scanning them. The b-4- case doesn’t apply here, again.

@Priyanka Singhal wrote:

Apart from this,I have another thing to ask. I am using acquire() function in the jtwain cpp file for acquiring multiple(all pages which have been placed on ADF) images.when i compile that file to generate a DLL file, I get the following two errors:

Error E2356 jtwain.cpp 332: Type mismatch in redeclaration of ‘__stdcall Java_ne
t_javajeff_jtwain_JTwain_ (JNIEnv_ *,_jclass *)’

Error E2344 jtwain.h 23: Earlier declaration of ‘__stdcall Java_net_javajeff_jtw
ain_JTwain_acquire(JNIEnv_ *,_jclass *)’.

Check the project settings in Visual Studio (if that’s what you’re using). I think you must set the C/C++ Code Generation to Multi-Threaded DLL.

If your project settings are correct, check for code mistakes like recursive includes, but if you can’t find such mistakes it might be some compilation or linking setting.

Quick Links

Service Providers
TWAIN Support Forums
Membership
Contact Us
Privacy Policy

Newsletter Signup

TWAIN Working Group Family

TWAIN Working Group
TWAIN Direct®
TWAIN Resources
TWAIN Certified Drivers
PDF/raster

  • Facebook
  • GitHub
  • LinkedIn
  • Vimeo

Recent Topics

  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • Problem enumerating list of installed scanners in windows server 2012
  • Failed to create TWAIN progress! Error code is 1260.
  • To get the list of scanners from javascript client side (browser)
  • Quarterly Newsletter
  • TWAIN Working Group Membership
  • Logo Usage
  • TWAIN License
  • Contact Us
Privacy Policy • Privacy Tools • Copyright © 2021 TWAIN Working Group • by iHwy, LLC • Log in