On Thu, 5 Jul 2007 21:45:03 +0200, Michael Schierl wrote:
> But I don't manage to get the page number of the current target - I get a
> PRIndirectReference, but how to make a page number from it?
I now "solved" it by doing a linear scan over all pages and look for the
one with the same reference number. It works, but it might get slow for
documents with lots of pages and lots of links. Better solutions still
appreciated.
My Patch is attached. I tested it on a bunch of PDF files, no problems so
far. Test program is the same as posted last week.
> The new function PdfReader#getLinks() will return an array of
> PdfAnnotation.PdfImportedLink. This link knows if it is internal to the pdf
> (#isInternal), and you can transform the bounding rectangle and the
> destination point by a 2x3 matrix (the same matrix you used for tranforming
> the pages with PdfContentByte#addTemplate(template,a,b,c,d,e,f)). These
> PdfImportedLinks can later be converted to PdfAnnotation objects and added
> to the PdfWriter (or discarded if the destination page is not in the new
> PDF).
Michael

Attachment:
keep-hyperlinks.patch-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/