错误报告 - 条形码:默认字体的副作用

时间:2014-05-05 19:57:54

标签: java pdf itext

在过去的两周里,我被条形码后插入的重叠数字字符卡住了。 我最后通过为所有段落指定所需的字体来修复它

代码工作:

document.addCell(new Paragraph("1234", BASIC_FONT));

包含Overlaped / bad kerning字体的代码:

document.addCell(new Paragraph("1234"));

老实说,我没有深入了解库的源代码,但我认为BarCode生成有副作用(你可能会覆盖整个文档的默认字体)

我的解决方案:在条形码生成后恢复默认字体

详细信息:

  • icepdf 5.0.2(用于渲染)
  • iText 5.4.5
  • barcode39

用于条形码生成的代码

    Barcode39 myBarCode39 = new Barcode39();
    myBarCode39.setCode(myText);
    myBarCode39.setStartStopText(false);
    Image myBarCodeImage39 = myBarCode39.createImageWithBarcode(directContent, null, null);
    return myBarCodeImage39;

Part of a pdf who got the problem

最好的问候

0 个答案:

没有答案