I've tried many variations to get a header to appear and have been
unsuccessful.
Have I missed something?
Also, is there a way to set a footer for each page?
import java.io.*;
import com.itextpdf.text.*;
import com.itextpdf.text.pdf.*;
public class Test{
public static void main(String argv[]) throws Exception {
Document document=new Document();
Test.addMetaData(document);
document.addHeader("Header Name", "Header Text");
PdfWriter writer = PdfWriter.getInstance(document, new
FileOutputStream("pdf.pdf"));
document.open();
Test.addTable(document);
document.newPage();
Test.addTable(document);
Test.addTable(document);
document.close();
}
private static void addMetaData(Document document) throws
Exception {
document.addTitle("Title");
document.addSubject("Subject");
document.addKeywords("Keywords");
document.addAuthor("Author");
document.addCreator("Creator");
}
private static void addTable(Document document)throws Exception
{
PdfPTable table=new PdfPTable(2);
table.addCell("Field 1");
table.addCell("Value 1");
table.addCell("Field 2");
table.addCell("Value 2");
document.add(table);
}
}
--
Frank Barbarino
Systems Engineer
------------------------------------------------------------------------------
This SF.net email is sponsored by
Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions:
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/