Click here to Skip to main content
14,872,784 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to read the free draw (pencil) annotations of a PDF using ITextSharp. I can get the annotations but do not know how to get the line drawn graphics.

What I have tried:

<pre>        for (int i = 1; i <= reader.NumberOfPages; i++)

            PdfDictionary page = reader.GetPageN(i);
            PdfArray annotsArray = null;

            if (page.GetAsArray(PdfName.ANNOTS) == null)

            annotsArray = page.GetAsArray(PdfName.ANNOTS);
            for (System.util.ListIterator< PdfObject > iter = annotsArray.GetListIterator(); iter.HasNext();)

                PdfDictionary annot = (PdfDictionary)PdfReader.GetPdfObject(iter.Next());

Updated 12-Sep-17 17:36pm

1 solution

This looks like a good resource for all common questions for iTextSharp: Frequently asked developer questions (iText 5) | iText Developers[^]

And this may point you in the right direction: c# - Reading PDF File Attachment Annotations with iTextSharp - Stack Overflow[^]

(found using this search: read image annotations of a PDF using ITextSharp -
Google Search
Member 10402992 13-Sep-17 0:48am
None of these examples show what filter(s) to use to determine the annotation of line draw.
Graeme_Grant 13-Sep-17 0:52am
I never indicated that it was the answer, only that it may point you in the right direction.
Member 10402992 13-Sep-17 0:56am
ok. Thank you. I Had seen those. There doesn't appear to be many trying to read drawn graphics as comments.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900