Hello,

I generate a PDF document with lots of data.

Here is some sample code:

String docName = Tools.get_tmp_path()+System.currentTimeMillis()+".pdf";
PdfWriter writer = PdfWriter.getInstance(document, new 
FileOutputStream(docName));
writer.setPageEvent(new PdfPageEventHelper() {
    public void onStartPage(PdfWriter writer, Document document) {
        // add page x of y
    }
});

I add a PdfPageEventHelper to add the page number at the beginning of each 
page. Getting the actual page number is no problem.
How can I add the page number in the following format: "page x of y" (y 
should be the page count of the document when all the contents was added). 
How can I get the page count of the final document?

best regards
Marcus
Germany


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to