Home › Forums › TWAIN Classic › How can we stop scanner?
- This topic has 11 replies, 3 voices, and was last updated 15 years, 5 months ago by ap.
- AuthorPosts
Hi All,
I am developing one scanning application in java.For that i have used jtwain implementation.In my application i have one requirement i.e. user will start scanning suppose with color image and after scanning two pages he want to stop scanning forcefully and change scanning properties like he want to scan as black and white image for remaining pages.I know how to set properties to scanner at the beginning of scanner start,but my problem is i want to stop scanner or pause scanner so that i can change scanner properties.If any one have some idea over this it will be very valuable for me to move ahead in my application.Please give some solution for this it’s very urgent.Thanks in advance
The application drives the TWAIN state, not the scanner’s DS. In the scenario you mentioned, your app can transfer 2 color scans, transition back to TWAIN state 4, renegotiate capabilities for a B/W scan, and then start the scan.
Please see the TWAIN specification for details. If you’re still stuck after digging into the spec, we’re here to help.
–
Hi All,
Thanks for your quick reply.I know we have to go to state 4 for renegotiating scanner property.But how can we go to state 4 from state 7 forcefully.I have one more query in my one scenario i want to scan one page color and black and white front back (duplex).Tell me how can we set parameter for scanner to scan like this.I have already gone through twain specification for setting scanner property but i haven’t got any helpful information in it.Please give some good way how can we set scanner property like single page will be color and b/w duplex.Thanks in advance.
go back thru the spec. you’re probably quicker than I am, but it took my a good 3 or 4 reads through before it started if make any real sense.
getting back to 4 from 7 isn’t so tricky,.. if you are tracking the state changes. are you tracking the state changes?
i want to scan one page color and black and white front back
ask that again but with different words.
.
Hi Sir,
Thanks for your reply. I am developing my application since 2-3 months, before stating it I already gone through specification. I am tracking the state change event of scanner.
Here I have written sample code .
public void update(ScannerIOMetadata.Type type, ScannerIOMetadata metadata){TwainSource source = ((TwainIOMetadata) metadata).getSource();
if(type.equals(ScannerIOMetadata.ACQUIRED)){
BufferedImage image=metadata.getImage();
//here I am saving image………….
}else if(type.equals(ScannerIOMetadata.NEGOTIATE)){
//here I am setting properties for scanner…………..
}else if(type.equals(ScannerIOMetadata.STATECHANGE)){
//here I am tracking statechange………….
}else if(type.equals(ScannerIOMetadata.EXCEPTION)){
}
}
Also please tell me, I want to scan one page in duplex mode with color and black and white format when it gets scanned.
How can we set properties for that? I am using Kodak scanner i40/i1420 for scanning.
Please give me some suggestion it’s very urgent for me.Thanks in advance.
what does “with color and black and white format” mean?
.
Hi gabe,
It means we want to single page in color as well as in Black&White from front side and back side also.Please tell me some idea how can i set property of scanner to scan like this.I have seen this type of setting in Kodak capture software,we can set it.
Please It’s very urgent for me.Thanks in Advance
ah. not all scanners support that, only Kodak as far as I know. If your scanner supports EnableDsUiOnly I’d use that along with CustomDsData. Search the forum and the spec for details, post back if you’re having trouble with the output from twister for the device in question.
.
Hi gabe,
Yes, my scanner support both properties EnableDsUiOnlyand CustomDsData.But i am not able to set exact property for scanner.In my coding i have set ICAP_PIXELTYPE to rgb and then black and white and duplex true.But while scanning paper get’s scanne din black and white only not color.
Please tell how can i set property for scanning paper in both pixel type at time.Thanks in advance
pick a language.
.
Hi gabe,
Sorry sir but i am not getting your point..Please tell me any solution for
my problem.Thanks in Advance
Hi All,
I wondered, really nobody have some idea for my problem.Please give some solution it’s very urgent for meThanks in Advance
- AuthorPosts