I would like to create a header. For this I create a PdfPTable with one
PdfPCell and add some Pararaphs into the PdfPCell with the addElement method.
My Problem is that the Document is empty.
Any ideas?
Code:
Rectangle page = document.getPageSize();
PdfPTable table = new PdfPTable(1);
PdfPCell cell = new PdfPCell();
Paragraph paragraph = new Paragraph("Hello World");
cell.addElement(paragraph);
table.addCell(cell);
table.setTotalWidth(page.width() - document.leftMargin() - document.rightMargin
());
table.writeSelectedRows(0, -1, document.leftMargin(), document.topMargin(),
writer.getDirectContent());
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/