代码之家  ›  专栏  ›  技术社区  ›  Agustin Lopez

Zxing PDF417编辑填充/安静区

  •  0
  • Agustin Lopez  · 技术社区  · 10 年前

    我正在使用zing库生成PDF417条形码。这一切都很好。。。

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

    但我想知道,是否有任何方法可以编辑两边还剩多少安静区?类似的东西。。。 http://www.racoindustries.com/barcodegenerator/2d/pdf417.aspx 这允许您选择每一侧有多少空间。

    我已尝试添加此EncodeHintType.MARGIN,但对于这种类型的条形码,它不起作用。

    有什么想法吗?

    1 回复  |  直到 10 年前
        1
  •  2
  •   Michael    10 年前

    在最新版本3.0.0中,zxing添加了对PDF417的EncodeHintType.MARGIN的支持。