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

MicroPDF417 Not Encoding ASCII Lower Than Decimal 32


Hello, we have a need to encode non-printable ASCII characters (characters 0-31 decimal) in a microPDF417 symbol. We are using the Java Barcode Library to do this. We have applyTilde set to true and have verified that using the tilde code does work for printable ASCII characters, but still does not work for non-printable characters. We are using a scanner that outputs the hex value for non-printable characters and have verified with other symbologies created with the IDAutomation libraries. Below is a sample test to show the behavior. I am attaching the output images that I receive when this test is run with both the record separator character (decimal 30) and an ampersand (decimal 38).

Java version info:
C:devspectrum2023.1.1-0_5.1.0sourcedriverdriver-imaging>java -version
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)

C:devspectrum2023.1.1-0_5.1.0sourcedriverdriver-imaging>mvn --version
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: C:devtoolsapache-maven-3.9.9
Java version: 1.8.0_412, vendor: Azul Systems, Inc., runtime: C:Program FilesJavazulu8.78.0.20-sa-jdk8.0.412-win_x64jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"

@Test
public void IDATest() throws Exception {
DataBar bc=new DataBar();
bc.setName("Test ASCII");
bc.setAutoSize(false);
bc.setSymbologyID(DataBar.MICROPDF417);
bc.setLeftMarginCM(0);

String data = "~030TEST"; // Does not encode. Encodes "TEST"
// String data = "~038TEST"; // Encodes "&TES"
bc.setDataToEncode(data);
bc.setXtoYRatio(2);
bc.setPixelsPerCM(236);
bc.setXDimensionCM(0.05184745762711865f);
bc.setBarHeightCM(0.33528f);
bc.setSize(12750,4500);
bc.setPDFMode(0);
bc.setPDFColumns(1);
bc.setTopMarginCM(0.0);
bc.setApplyTilde(true);
int iwidth = 500;
int iheight = 200;
int padding = 125;
iwidth += padding;
iheight += padding;
BufferedImage image = new BufferedImage(iwidth, iheight, java.awt.image.BufferedImage.TYPE_BYTE_BINARY);
java.awt.Graphics imgGraphics = image.createGraphics();
imgGraphics.setColor(Color.WHITE);
imgGraphics.fillRect(0, 0, iwidth, iheight);
bc.paint(imgGraphics );

try (FileOutputStream fos = new FileOutputStream("c:tempmicropdf417.png")) {
ImageIO.write(image, "png", fos);
}
}


Application: Java DataBar library

04-08-25     51 day(s) ago    

  Report Abuse

 

Brant

Best Answer

The customer was able to get lower ASCII functions to encode properly by changing the compaction encoding mode to Binary or Byte. The default encoding of MicroPDF417 is ASCII mode, which only encodes numbers and letters. MicroPDF417 is a rarely used barcode type, and encoding the lower ASCII functions within it is an even rarer scenario. The standard for MicroPDF417 is ISO/IEC 24728:2006. Annex B shows the full ASCII character set available when encoded with byte encoding.

Posted 14 day(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