Olá pessoal
estou precisando colocar o total de páginas em um arquivo rtf, mas não está dando muito certo =/
Código:
Document document = new Document();
RtfWriter2.getInstance(document, new FileOutputStream("TotalPageNumber.rtf"));
// Create a new Paragraph for the footer
Paragraph par = new Paragraph("Page ");
// Add the RtfPageNumber to the Paragraph
par.add(new RtfPageNumber());
// Add the RtfTotalPageNumber to the Paragraph
par.add(" of ");
par.add(new RtfTotalPageNumber());
// Create an RtfHeaderFooter with the Paragraph and set it
// as a header for the document
RtfHeaderFooter header = new RtfHeaderFooter(par);
document.setHeader(header);
document.open();
for(int i = 1; i <= 300; i++) {
document.add(new Paragraph("Line " + i + "."));
}
document.close();
e estou usando as libs: iText-1.3.1 e iText-rtf-2.1.4
Será que alguém pode me ajudar?
Att 