loop annotations

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

loop annotations

René Rakitow

Hello,

 

Im trying to loop through the annotations of a pdf and find the name of it and its data

 

I have the following code;

 

Private Sub GetAnnots(PdfFile As String)

 

        Dim PdfReader As New PdfReader(PdfFile)

        Dim PageDictionary As PdfDictionary = Nothing

        Dim AnnotArray As PdfArray = Nothing

        Dim Annotation As PdfDictionary = Nothing

        Dim PdfString As PdfString = Nothing

        Dim AnnotationDictionary As PdfDictionary = Nothing

 

        For page = 1 To PdfReader.NumberOfPages

            PageDictionary = PdfReader.GetPageN(page)

            AnnotArray = PageDictionary.GetAsArray(PdfName.ANNOTS)

 

            If Not AnnotArray Is Nothing Then

                For Each pdfobj As PdfObject In AnnotArray.ArrayList

                    AnnotationDictionary = DirectCast(PdfReader.GetPdfObject(pdfobj), PdfDictionary)

 

 

‘’ HOW do I go further?

 

 

                Next

 

            End If

 

        Next

 

    End Sub

 

 

 

Kind regards,

 

René

 


JAZO Zevenaar bv
Postbus 360
6900 AJ Zevenaar NL
Handelsdwarsstraat 10
6905 DJ Zevenaar NL
Industrieterrein Zuidspoor

Tel.: + 31 (0) 316 59 29 11
Fax: +31 (0) 316 34 16 74
Internet: www.jazo.eu
KvK Arnhem, HR 09038319

 

Please consider the environment before printing this e-mail!

Disclaimer:
This e-mail message, including any attachment(s), is intended solely for the addressee or addressees and is strictly confidential or otherwise legally protected. If you are not the intended recipient of this communication please return this e-mail message and the attachment(s) to the sender and delete and destroy all copies. JAZO Zevenaar bv is not liable for any viruses contained in this e-mail message and/or in the attachment(s). JAZO Zevenaar bv cannot be held responsible or liable in any way whatsoever for and/or in connection with any consequences and/or damage resulting from the improper, incomplete and untimely dispatch and receipt of the content of this e-mail.


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
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
Reply | Threaded
Open this post in threaded view
|

Re: loop annotations

iText mailing list
Can you post this on http://stackoverflow.com using the tag iTextSharp?
We're no longer using the mailing-list. See http://itextpdf.com/support

Also: please explain in more detail what you expect to extract. There's a list of 26 types in ISO-32000-1 (and there will be 29 types in ISO-32000-2 of which 2 will be deprecated). Depending on the type, it is not clear what you mean when you say you want to get the data from these annotations. Each annotations has its own set of properties. Are you looking for link annotations? widget annotations? text annotations?

In short: you're asking only half a question. You should ask us a full question if you expect an answer.

(Please do not respond to this mail. This INBOX isn't monitored as frequently as StackOverflow. Note that your mail had to be approved manually because you weren't subscribed to the mailing-list...)

On 5/11/2015 22:03 PM, René Rakitow wrote:

Hello,

 

Im trying to loop through the annotations of a pdf and find the name of it and its data

 

I have the following code;

 

Private Sub GetAnnots(PdfFile As String)

 

        Dim PdfReader As New PdfReader(PdfFile)

        Dim PageDictionary As PdfDictionary = Nothing

        Dim AnnotArray As PdfArray = Nothing

        Dim Annotation As PdfDictionary = Nothing

        Dim PdfString As PdfString = Nothing

        Dim AnnotationDictionary As PdfDictionary = Nothing

 

        For page = 1 To PdfReader.NumberOfPages

            PageDictionary = PdfReader.GetPageN(page)

            AnnotArray = PageDictionary.GetAsArray(PdfName.ANNOTS)

 

            If Not AnnotArray Is Nothing Then

                For Each pdfobj As PdfObject In AnnotArray.ArrayList

                    AnnotationDictionary = DirectCast(PdfReader.GetPdfObject(pdfobj), PdfDictionary)

 

 

‘’ HOW do I go further?

 

 

                Next

 

            End If

 

        Next

 

    End Sub

 

 

 

Kind regards,

 

René

 


JAZO Zevenaar bv
Postbus 360
6900 AJ Zevenaar NL
Handelsdwarsstraat 10
6905 DJ Zevenaar NL
Industrieterrein Zuidspoor

Tel.: + 31 (0) 316 59 29 11
Fax: +31 (0) 316 34 16 74
Internet: www.jazo.eu
KvK Arnhem, HR 09038319

 

Please consider the environment before printing this e-mail!

Disclaimer:
This e-mail message, including any attachment(s), is intended solely for the addressee or addressees and is strictly confidential or otherwise legally protected. If you are not the intended recipient of this communication please return this e-mail message and the attachment(s) to the sender and delete and destroy all copies. JAZO Zevenaar bv is not liable for any viruses contained in this e-mail message and/or in the attachment(s). JAZO Zevenaar bv cannot be held responsible or liable in any way whatsoever for and/or in connection with any consequences and/or damage resulting from the improper, incomplete and untimely dispatch and receipt of the content of this e-mail.



------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y


_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
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


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
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