I am using a very very old version of itext (1.4.1). Everything works fine, but I want to add the header and footer on every page of the pdf-document, instead of only at the top and bottom of the document.
I figured I have to do this before I open the document. However, I can not add images before I open the document, only watermarks. But a watermark is behind the rest of the text...
Is there anyway to do this?
Document document = new Document();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
PdfWriter.getInstance(document, baos);
Image image = getImage(IMAGE_NAME_LOGO);
Chunk chunk = new Chunk(image, 0,0);
HeaderFooter footer = new HeaderFooter(new Phrase(chunk), null); //error here
document.open();
document.add(text);
(..)
}