Problems with CJS_Document::getAnnots interface

35 views
Skip to first unread message

Kuka

unread,
May 26, 2025, 5:00:36 AMMay 26
to pdfium
The number of arrays returned by the CJS_Document::getAnnots interface is the number of pages, not the number of annotations for all the pages combined.

Justin Pierce

unread,
May 26, 2025, 8:49:49 AMMay 26
to Kuka, pdfium
I guess what you mean is that it returns an array of size N, where N is equal to the number of pages? 

Looking at the code, this looks like a bug:

```



pRuntime->PutArrayElement(
annots, i,
pJS_Annot ? v8::Local<v8::Value>(pJS_Annot->ToV8Object())
: v8::Local<v8::Value>());

```

It places each new element at index i, which is the current page index. 

Can you file a bug report? I'm happy to fix it, seems like an easy fix. 

Thanks, 
Justin Pierce 

Thanks, 
Justin Pierce

From: pdf...@googlegroups.com <pdf...@googlegroups.com> on behalf of Kuka <tyck...@gmail.com>
Sent: Monday, May 26, 2025 4:00:36 PM
To: pdfium <pdf...@googlegroups.com>
Subject: Problems with CJS_Document::getAnnots interface
 
The number of arrays returned by the CJS_Document::getAnnots interface is the number of pages, not the number of annotations for all the pages combined.

--
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 view this discussion visit https://groups.google.com/d/msgid/pdfium/31fc2ef8-54ed-4e63-87e8-6f774d51c23bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages