There is no reason why you cannot do this before calling document.close();
as Bruno suggested. Instead of doing it on onCloseDocument(); callback which
seems to have some side effects. Add another method to your
PdfPageEventHandle like addFinalSummaryPage();(with parameters you need like
document, writer etc.) and call that before you call document.close(); and
you can use any method you want to add the content and you should have all
the information you need in the eventHandler. I find this sounder than doing
stuff in onCloseDocument.
Nurettin
On Thu, Oct 28, 2010 at 8:19 AM, 1T3XT info <[email protected]> wrote:
> On 28/10/2010 14:01, riffla wrote:
> >
> > I guess you´re right about one thing, I think I need to aproach this from
> > somewhere else. But it's actually possible to create another page in the
> > onCloseDocument.
>
> That's a side-effect I didn't know about.
> Note that you're not adding that page to the Document
> object you've been using to add objects with document.add().
> The document object you're using in the page event is of
> type PdfDocument and that's why:
>
> > It gave me an empty last page, but with
> > none of the output I tried to render from this method (tried all of
> > writer.getDirectContent().showTextAligned(...), writeSelectedRows(...)
> and
> > document.add(new Paragrapgh("..."))) but it's all empty. Only things that
> > work is those things I add through PdfTemplate...
>
> As I said, onDocumentClose wasn't designed for this use.
> If possible, you should use a different approach.
>
> Thanks for the feedback!
> --
> This answer is provided by 1T3XT BVBA
> http://www.1t3xt.com/ - http://www.1t3xt.info
>
>
> ------------------------------------------------------------------------------
> Nokia and AT&T present the 2010 Calling All Innovators-North America
> contest
> Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in
> marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> http://p.sf.net/sfu/nokia-dev2dev
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Many questions posted to this list can (and will) be answered with a
> reference to the iText book: http://www.itextpdf.com/book/
> Please check the keywords list before you ask for examples:
> http://itextpdf.com/themes/keywords.php
>
--
Nurettin DAG
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php