Get the annots array from the page and look for the correct subtype.

----- Original Message ----- 
From: "John M. Langley" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, March 28, 2005 5:21 PM
Subject: [iText-questions] Reading Annotations


> Hi--
>
> I need to know how to open a PDF document and read the annotations
> available.  I've tried using DumpFields.java located in the examples to
> see if I could use that as a baseline for finding these annotations,
> however, when I run it against my PDF file, it simply states "The
> document has no fields." -- which is true, it only has annotations.  The
> example I used to generate a PDF with text annotations is the one
> located at:  http://www.lowagie.com/iText/examples/Chap0303.java.
>
> How would I be able to read the "books" and "authors" annotations
> created by the example?  I would generally know the "name" of the
> annotation in advance, so if there is a way to get straight to the field
> vs. iterating through an array/dictionary to find it, this would be
better.
>
> I assumed that DumpFields must be close, and commented out the code that
> checked for presence of fields, so basically it would always run the for
> loop that iterated through the pages.  Of course, this just resulted in
> an empty output file, so I was wonderring what would need to be done to
> make it work for true annotations vs. fields.  I've tried changing the
line:
> PdfArray annots =
> (PdfArray)reader.getPdfObject((PdfObject)dPage.get(PdfName.ANNOTS));
>
> to use different PdfName constants, but I've had no luck with that yet
> and am even wondering if this is possible.
>
> My end goal is to generate a PDF with text annotations, and at some
> later point, read these annotations back in, all using iText.
>
> Thanks,
> -John Langley
>
>
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to