Thx for those fast replies i will check this.

Stefan

Bruno Lowagie (iText) wrote:
Stefan Colella wrote:
Hello,
I am trying to work with Annotations of a pdf documents. I need to find internal pdf links and their destination. Is it possible to get all the annotation of a pdf document like internal links and the destination of that annotation (link) with IText . I saw that its possible to create annotations but didn't see something to get them of an existing document.

You could use iText to iterate over all the pages and
retrieve the annotations of each page in the form of
a PdfDictionary object.

For instance, if you want to find the annotations in page 1:
PdfReader reader = new PdfReader("my.pdf");
PdfDictionary page = reader.getPageN(1);
PdfArray annots = page.get(PdfName.ANNOTS);

You can now inspect what's inside the array with
annotations (probably a lot of indirect references
to PDF dictionaries); some of these dictionaries
will be annotations with links, some of them will
be other types of annotations.

You'll have to check the PDF reference if you
want to know more about it.

Note that there are also other ways to add a
link to a PDF. You could for instance add a button
in an AcroForm that jumps to another page when you
click it. In this case, you will also have to inspect
the AcroFields in your PDF.

Class SimpleNamedDestination will give you an
overview of the named destinations in a PDF.

br,
Bruno

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to