문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top