我使用iText 5.2.1,并且我已经创建了Document对象。如何在iText 5.2.1中添加标题?
这样的:
document.addHeader("hello");
为什么我没有看到在PDF文件中的标题?
我使用iText 5.2.1,并且我已经创建了Document对象。如何在iText 5.2.1中添加标题?
这样的:
document.addHeader("hello");
为什么我没有看到在PDF文件中的标题?
try {
Document document = new Document();
PdfWriter.getInstance(document, new FileOutputStream("FicheClient.pdf"));
document.open();
document.add(new Paragraph("hello World",FontFactory.getFont(FontFactory.TIMES_BOLD,20,Font.BOLD,BaseColor.BLACK)));
document.add(new Paragraph("---------------------------------------"));
document.close();
JOptionPane.showMessageDialog(null, "Raport saved ");
} catch (Exception e) {
}
可能重复的[添加标题,利用iText PDF](http://stackoverflow.com/questions/5062898/add-header-to-pdf-using-itext) – sloth