首页 > 解决方案 > 如何在 itext pdf Java 中创建无边框的 pdfTemplate?并且它也延伸到下一页

问题描述

PdfTemplate template = cb.createTemplate(width, height);
template.addImage(bg, width, 0, 0, height-10, 0, 0);
template.addImage(signature, 39, 0, 0, 39, 15, height-50);
BaseFont bf = BaseFont.createFont(fontPath, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
Font arabfont = new Font(bf, 8);
ColumnText.showTextAligned(template, Element.ALIGN_LEFT,
    new Phrase("XXXXXXXXX",arabfont), 60, height-25, 0);
ColumnText.showTextAligned(template, Element.ALIGN_LEFT,
    new Phrase("XXXXXXXXX", new Font(Font.TIMES_ROMAN  , 11, Font.BOLD)), 60, height-40, 0);
template.addImage(profileimg, 47, 0, 0, 55, (width/2)+60, (height/2)+10);
Integer h=20;
for (String detail : details) {
    ColumnText.showTextAligned(template, Element.ALIGN_LEFT,
        new Phrase(detail, new Font(Font.HELVETICA  , 8, Font.BOLD)), 10, (height-40)-h, 0);
    h=h+10;
}

在这个图像中有一个模板边框,延伸到下一页。 在此处输入图像描述

标签: javapdfitextapache-poi

解决方案


推荐阅读