New User? Sign Up  |  Sign In  |  Help
Barcode support and
tutorials from IDAutomation
and the community.
Click for the BBB Business Review of this Computers Hardware, Software & Services in Tampa FL
Resolved Questions

NumberFormatException Painting Intelligent Mail Barcode Java

Hello!

I'm trying to paint an IntelligentMail Barcode onto a basic Canvas in Java, and I'm receiving a NumberFormatException. This looks quite like what would happen if too large a number was parsed as an integer, so I'm wondering if it's a bug in the IDAutomation code.

Here's a short code example to demonstrate what I mean:

BarCode bc = new BarCode();
bc.setSymbologyID(BarCode.ONECODE);
// Failing Data - 0030090109419800000078676253041
// Good Data - 0123456709498765432101234567891
bc.setDataToEncode("0030090109419800000078676253041");
BufferedImage image = new BufferedImage(2500, 800, BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = image.createGraphics();
g2.setColor(Color.white);
g2.fillRect(0, 0, image.getWidth(), image.getHeight());
bc.paint(g2);


This results in the exception:

Exception in thread "main" java.lang.NumberFormatException: For input string: "78676253041"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:583)
at java.lang.Integer.valueOf(Integer.java:766)
at com.idautomation.linear.BarCode.paintONECODE(BarCode.java:4814)
at com.idautomation.linear.BarCode.paintBasis(BarCode.java:3804)
at com.idautomation.linear.BarCode.paint(BarCode.java:3692)
at com.cybra.utilitiesh2.IMBTest.codeExample(IMBTest.java:55)
at com.cybra.utilitiesh2.IMBTest.main(IMBTest.java:21)

I'm using this Barcode package which should support IMB: https://www.idautomation.com/barcode-components/java/

And here is my manifest for the IDAutomation LinearBarCode.jar:

Manifest-Version: 1.0
Name: com/idautomation/linear/BarCode.class
java-Bean: True
Implementation-Version: 4.10
Specification-Title: Java Barcode Package
Specification-Version: 4.10
Implementation-Title: Java Barcode Package
Created-By: 1.3.0 (Sun Microsystems Inc.)
Implementation-Vendor: IDAutomation.com, Inc.
Specification-Vendor: IDAutomation.com, Inc.

The commented "good data" works just fine. Any help would be greatly appreciated!

Thanks,
Jer


Application: Java

10-05-21     3.2 year(s) ago    

  Report Abuse

 

Ben

Best Answer

Make certain that the latest version of the IDAutomation Java Barcode Component, released in June 2017 (for the Linear version), runs. The Java Barcode Component uses Java 1.4.2 (minimum).

Here is a list of Java Component updates:

• New image file options with the addition of SVG and EPS.
• Update requires JDK 1.4 and above now. Updated image encoder from com.sun.image.codec.jpeg.JPEGImageEncoder to use ImageIO.write for JDK7 images.
• Added advanced support for GS1, ISBT and HIBC tilde options.
• Updated the QR-Code JavaDoc documentation and the QR Code Servlet documentation.
• Added FNC3 and FNC4 support.

Activate Level 2 Support Plan

Posted 3.2 year(s) ago

(0)
(0)
  Report Abuse
 
Find Interesting
 
Email to Others
 
Bookmark
 
Subscribe to Answer Alert
No comments yet.     Be the first to comment.

Email this question link to friends
You must enter an email address, if name is entered or vice-versa for each friend.
Friend #1 -
Friend #2 -
Friend #3 -
Friend #4 -
Friend #5 -
  Your comment on this question
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allows to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must starts with "http://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always starts with " http:// ")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 Characters are allowed. Current Count: 0
  Your comment on this answer
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allow you to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must start with "http://" or "https://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always start with "http://" or "https://")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 characters are allowed. Current Count: 0

You may answer and comment on any thread according to the Terms and Conditions.

 © Copyright 2021 IDAutomation.com, Inc., 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