Op 3/02/2011 14:35, Michael Schreiber schreef: > First of all thank you very much for this great PDF library!! > I've been using it a lot lately and I've always been very happy with the > generated PDFs. > > As I couldn't find a solution to my problem in this mailing-list I decided to > ask for any suggestions on how to solve this problem. > > I create a PDF document from scratch containing different elements like > Chapters, Sections, PdfPTables, Paragraphs and so on. For internal link > functionality I'm using Chunks like this: > > Chunk linkSource = new Chunk("Details"); > linkSource.setLocalGoto("id_123"); > document.add(linkSource); > > Later on in the document I'm adding the linkTarget chunk: > > Chunk linkTarget = new Chunk(" "); > linkTarget.setLocalDestination("id_123"); > document.add(linkTarget); > > This works perfectly fine. > But what I want to do now is that the linkSource chunk title contains the > page number where the linkTarget can be found in the document. > So instead of "Details" I want something like "page X" where X is the page > number where the linkTarget is. > The purpose is that if someone prints the document he's still able to follow > the link on paper. > How can I achieve this? > At the moment of creating the linkSource I have no idea at what page the > linkTarget will be placed. > I was thinking of the onGenericTag method of the PdfPageEvent but I don't > know how to change the title of the sourceChunk if it's already added to the > document. > > I would be very thankful for any hints or suggestions on how to solve this > problem.
Please define "Details". Is it a property of the link annotation (not part of the content stream)? Or is it the text used for the Chunk (part of the content stream)? PS: you have posted a mail to itext-questions@lists.sourceforge.net but you weren't subscribed. You are receiving this answer because I've added your mail address in Bcc: I will do this only once! Further answers will be sent to the mailing-list only (you won't receive them if you don't subscribe). Further questions to the mailing-list will be rejected unless you subscribe. Further questions sent to the 1t3xt address will be ignored. Please understand that, as long as you don't subscribe, somebody has to MANUALLY approve your mail among a huge load of SPAM. You can help us avoid this boring administrative job by following the rules: http://itextpdf.com/support.php ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net 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