zjh
2024-12-06 c42f62b32bac302a7ac9fcde7489f7c5fc6e11aa
ltkj-admin/src/main/java/com/ltkj/web/config/pdfutils/MyHeaderFooter.java
@@ -67,7 +67,7 @@
        //生成左侧页眉
        ColumnText.showTextAligned(writer.getDirectContent(),
                Element.ALIGN_LEFT, new Paragraph("XXX健康体检中心——"+DateUtils.getDate(), hfFont),
                Element.ALIGN_LEFT, new Paragraph("健康体检报告"+DateUtils.getDate(), hfFont),
                document.left(), PageSize.A4.getHeight() - 30, 0);
//        //生成右侧页眉
@@ -77,9 +77,9 @@
    }
    // 全部完成后,将总页数的pdf模版写到指定位置
    public void onCloseDocument(PdfWriter writer, Document document) {
        String text = "共" + (writer.getPageNumber()) + "页";
        ColumnText.showTextAligned(totalPage, Element.ALIGN_MIDDLE, new Paragraph(text, hfFont), 0, 0, 0);
    }
//    public void onCloseDocument(PdfWriter writer, Document document) {
//        String text = "共" + (writer.getPageNumber()) + "页";
//        ColumnText.showTextAligned(totalPage, Element.ALIGN_MIDDLE, new Paragraph(text, hfFont), 0, 0, 0);
//    }
}