API to retrieve the annotations by using Annotation Types Macros.

147 views
Skip to first unread message

Parthipan R

unread,
Sep 11, 2018, 7:01:46 AM9/11/18
to pdfium
FPDFPage_GetAnnot API is used to get the annotation from the page by using index of FPDFPage_GetAnnotCount result. It is not fare to check the single annotation (like link annotation) is available or not in a page. Is there any API to retrieve the annotations using Annotation Types Macros instead of index value? 

Dan Sinclair

unread,
Sep 11, 2018, 9:09:12 AM9/11/18
to Parthipan R, pdfium
That API doesn't exist, you can do the same by looping through all the annotations and storing into a hash if you need to be able to look them up by type.

dan


On Tue, Sep 11, 2018 at 7:01 AM Parthipan R <rpart...@gmail.com> wrote:
FPDFPage_GetAnnot API is used to get the annotation from the page by using index of FPDFPage_GetAnnotCount result. It is not fare to check the single annotation (like link annotation) is available or not in a page. Is there any API to retrieve the annotations using Annotation Types Macros instead of index value? 

--
You received this message because you are subscribed to the Google Groups "pdfium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdfium+un...@googlegroups.com.
To post to this group, send email to pdf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdfium/d7931434-dd6a-4894-b1c7-06589c9187b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Parthipan R

unread,
Sep 12, 2018, 12:36:15 AM9/12/18
to pdfium
Thanks for the details. 

is there any option for retrieving the destination of link annotation using this API?

Dan Sinclair

unread,
Sep 13, 2018, 10:33:25 AM9/13/18
to Parthipan R, pdfium
Depends on how the link is stored in the annotation, if it's in the dictionary you can use FPDFAnnot_HasKey and FPDFAnnot_GetValueType for the key/value. If it's a page object you can use those APIs.

dan



Reply all
Reply to author
Forward
0 new messages