Tag: footer

Freemarker,PDF,页眉/页脚和分页符

Freemarker的一个常见用途是生成PDF。 不幸的是,我必须生成一个包含大量页面的pdf,并且“他们”要求我提供一些包含一些信息的页眉和一些页脚,例如“第2/60页”等等… 在网上搜索我发现了如何创建一个宏模板,但它只共享一些常见的标签(如css),但它没有告诉freemarker如何管理多页PDF。 除此之外,有时我在ftl内部有一个“分页符css类”,所以我无法确定创建新页面的时间和地点。 我在Java上使用Freemakrer 2.3 谢谢你的帮助。

使用POI api向ms字添加页脚

我搜索了很多并获得了一些结果,其中有一些示例代码,但没有人工作。 所有要么得到空指针exception,要么生成文档然后在打开文件(.docx)时给出错误并显示消息文本/ xml声明可能只在innput的最开始发生。 我想可能是我正在添加一些内容,然后添加页脚是一个问题所以我粘贴我的页脚代码在这一次我现在得到了 索引超出范围的exception 这是我的完整代码 String fileName =”Book.docx”; String folderPath=SystemProperties.get(SystemProperties.TMP_DIR)+File.separator+”liferay” + File.separator + “document_preview”; String filePath=folderPath+File.separator+fileName; File file=new File(filePath); XWPFDocument document = new XWPFDocument(); XWPFParagraph paragraphOne = document.createParagraph(); paragraphOne.setAlignment(ParagraphAlignment.CENTER); XWPFRun paragraphOneRunOne = paragraphOne.createRun(); paragraphOneRunOne.setText(“Training Report”); paragraphOneRunOne.addBreak(); XWPFTable table = document.createTable(); XWPFTableRow tableRowOne = table.getRow(0); tableRowOne.getCell(0).setText(“No”); tableRowOne.createCell().setText(“Name”); XWPFHeaderFooterPolicy headerFooterPolicy = document.getHeaderFooterPolicy(); if (headerFooterPolicy == null) […]