Question

I am generating a PDF417 barcode with the zing library. All good with that...

writer = new PDF417Writer();
bitMatrix = writer.encode(barcodeMessage.getData(),
    BarcodeFormat.PDF_417, WIDTH, WIDTH / 2, // To maintain a width/height ratio
    ImmutableMap.of(
        EncodeHintType.PDF417_COMPACT, Boolean.TRUE,
        EncodeHintType.CHARACTER_SET, messageEncoding
    )
);

barcodeBg = MatrixToImageWriter.toBufferedImage(bitMatrix);

But I was wondering if there is any way to be able to edit how much quiet zone is left at each side? Something similar to this... http://www.racoindustries.com/barcodegenerator/2d/pdf417.aspx that allows you to select how much space you have on each side.

I have tried adding this EncodeHintType.MARGIN but for this type of barcode it does not work.

Any ideas?

Était-ce utile?

La solution

Support for EncodeHintType.MARGIN for PDF417 was added to zxing in the newest release 3.0.0.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top