Barcode Fonts, Components, ActiveX and .NET Windows Forms Controls, Java Servlets, 
DLLs and Barcode Scanners. IDAutomation.com, Inc., Computers Hardware, Software & Services, Tampa, FL   This site chose the Norton Secured Seal to promote trust online with consumers.    View your cart in the IDAutomation Store   


Java Resolution Tutorial & Information:

This tutorial provides pixel resolution information about IDAutomation's Java Barcode products such as:

Solution(s):

Most web browsers print from the screen image at 38 dots per cm or 96 DPI. In addition, JDK 1.1 to 1.2 applications always print at 96 DPI. However, the limitations can be solved in a few different ways:

  1. If the Java Servlet is used - The Servlet creates a JPEG image at 300 DPI resolution in the web browser. However, the web browser views this at 96 DPI. Since the IMG tag is used to embed the Servlet into HTML, it may be compressed or expanded as necessary. The minimum X dimension (narrow bar width) of the Java barcode is usually .03 cm (about 10 mils or 1/96"), and because the viewing area is reduced, the X dimension will be .015 cm or about 5 mils. Remember, because the screen resolution is 96 DPI, it will not look correct on the screen but it will print correctly because most printers have a DPI of 300 or more. For example, the code below reduces the image by 50%:
    <IMG height=40 alt="Barcode Image"
    src="http://localhost:8080/examples/servlet/LinearServlet?HEIGHT=80&WIDTH=160&BARCODE=12345678"
    width=80>
  2. If JDK 1.3 or greater is being used and printing from the Java application itself - The printer resolution may be set. Refer to the java.awt.PageAttributes.setPrinterResosution() in the JDK1.3 documentation.
  3. JDK 1.3 Example - An example of an application that prints with printer resolution and uses Java 2 (JDK 1.3) is in IDAutomation's Maxicode Java Package and may be downloaded here. The file ApplicationExample.java is the file in the package to view.
  4. When creating images for graphic applications, set the resolution to 118 to create a 300 DPI image.
  5. The resolution used to convert to pixels can be changed by using the method setPixelsPerCM(int) or resolution(int). By default this value is the screen resolution of pixels per cm. If resolution is set to 1, then 1 cm will equal 1 pixel.
  6. More information about pixels and resolutions of barcodes is provided in the Barcode Printing Issues with Low-Resolution Printers and Web Browser Barcode Resolution FAQ.
Related Documents:
 ©Copyright 2017 IDAutomation.com, All Rights Reserved. Legal Notices.

 Barcode Fonts | Components | Scanners | Support | Contact Us

Training Videos on YouTube  Join us on Google Plus  Join us on LinkedIn  Follow us on Twitter  Like us on Facebook
Over 70% of Fortune 100 companies use IDAutomation's products to automate their businesses.