tcronin
|
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
|