Set PDF_417 lineThickness to 1

- fine-grained scaling for PDF_417 generation
This commit is contained in:
Andreas Wenger 2015-07-15 15:51:24 +02:00
parent 43295b13a0
commit cc1a7aa86a

View file

@ -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);
}