From cc1a7aa86a37df7570dc26d3bd5e4f5171c5ee7c Mon Sep 17 00:00:00 2001 From: Andreas Wenger Date: Wed, 15 Jul 2015 15:51:24 +0200 Subject: [PATCH] Set PDF_417 lineThickness to 1 - fine-grained scaling for PDF_417 generation --- core/src/main/java/com/google/zxing/pdf417/PDF417Writer.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/google/zxing/pdf417/PDF417Writer.java b/core/src/main/java/com/google/zxing/pdf417/PDF417Writer.java index 0b4526c47..617c3990b 100644 --- a/core/src/main/java/com/google/zxing/pdf417/PDF417Writer.java +++ b/core/src/main/java/com/google/zxing/pdf417/PDF417Writer.java @@ -97,9 +97,8 @@ public final class PDF417Writer implements Writer { int errorCorrectionLevel = 2; encoder.generateBarcodeLogic(contents, errorCorrectionLevel); - int lineThickness = 2; int aspectRatio = 4; - byte[][] originalScale = encoder.getBarcodeMatrix().getScaledMatrix(lineThickness, aspectRatio * lineThickness); + byte[][] originalScale = encoder.getBarcodeMatrix().getScaledMatrix(1, aspectRatio); boolean rotated = false; if ((height > width) ^ (originalScale[0].length < originalScale.length)) { originalScale = rotateArray(originalScale); @@ -118,7 +117,7 @@ public final class PDF417Writer implements Writer { if (scale > 1) { byte[][] scaledMatrix = - encoder.getBarcodeMatrix().getScaledMatrix(scale * lineThickness, scale * aspectRatio * lineThickness); + encoder.getBarcodeMatrix().getScaledMatrix(scale, scale * aspectRatio); if (rotated) { scaledMatrix = rotateArray(scaledMatrix); }