Is there any way to create a bunch of pages then go back to the first page and start using it? OR is there a way to insert a page that you are creating into a specific spot in the document that you are creating - for example: I create a new Document then i add a few pages to the Document, then add content to a new page and insert it at the beginning of the Document. Is this possible? Thanks for the help.
Mark Storer-3 wrote: > > Mark Storer <mstorer <at> cardiff.com> writes: > >> Yep. >> > http://itext.svn.sourceforge.net/viewvc/itext/trunk/src/com/lowagie/text/pdf/PdfAction.java?revision=2526&view=markup: >> >> 457 public static PdfAction gotoLocalPage(int page, PdfDestination >> dest, >> PdfWriter writer) { >> 458 PdfIndirectReference ref = writer.getPageReference(page); >> 459 dest.addPage(ref); >> 460 PdfAction action = new PdfAction(); >> 461 action.put(PdfName.S, PdfName.GOTO); >> 462 action.put(PdfName.D, dest); >> 463 return action; >> 464 } >> > > Nope. My answer bothered me. If the getPageReferece return value was > null, > none of your links would work. They won't take you anywhere... but they > were > all taking you to the first page. > > So I did a little digging. PdfWriter.getPageReference() will create > references > to pages that don't exist yet. If there are more references than actual > pages, > you get an exception when you close the document, but other than that it's > perfectly safe. > > --Mark Storer > Senior Software Engineer > Cardiff.com > > #include <disclaimer> > typedef std::disclaimer<Cardiff> Discard; > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > 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/ > > -- View this message in context: http://www.nabble.com/problem-combining-dynamic-content-with-existing-pdf-tf4207181.html#a11987997 Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ 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/
