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

Reply To: How to set the resolution (DPI)?

Forums › TWAIN Classic › How to set the resolution (DPI)? › Reply To: How to set the resolution (DPI)?

November 17, 2008 at 5:16 am #24004
Shyam
Participant
  • Topics - 0
  • Replies - 1
  • Total Posts - 1

I am using JTwain and facing the same problem that dabd is facing. I have verified that the resolution (200 x 200) in which I am trying to scan is supported by the scanner. In fact I also verified that when UI is enabled we can see that the driver (in my case HP Scanner dialogue) has actually received the DPI settings, though getCurrentXResolution and getCurrentYResolution are reporting 1.0, but when the scanned image is verified in MSPaint it reports 96 x 96 DPI and GIMP reports 72 x 72 DPI.

The code snippet used is as below

      source.setUnits( JTwainConstants.TWUN_PIXELS );
source.setXResolution( 200.00 );
source.setYResolution( 200.00 );
ImageIO.write( source.acquireImageAsBufferedImage(), "jpeg", bos );
JpegBase64 = Base64.encode( bos.toByteArray() );
source.close();

Any help will be much appreciated.

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

  • TWAIN for dental imaging integration
  • PDF/R For who and where?
  • Making searchable PDF with PDF/R
  • Backward compatibility with PDF/A and traditional PDF
  • could not open the twain source. Make sure there is a valid source for your sca
  • 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