I use iText 5.2.1 and I have already created Document object.
like this:
document.addHeader("hello");
Why don't I see the header on the PDF File?
I use iText 5.2.1 and I have already created Document object.
like this:
document.addHeader("hello");
Why don't I see the header on the PDF File?
Use Page Events. Many good answers have been provided already on StackOverflow, for example this one, or this other one.
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) {
}