FPDFAnnot_GetObject and FPDFPageObj_GetMatrix

9 views
Skip to first unread message

Ann-Sofie

unread,
Jan 13, 2026, 12:52:20 PM (4 days ago) Jan 13
to pdfium
I'm trying to understand if this is a bug (or if I simply misunderstood something because pdfium is very new to me). In our software we have a user that uploaded a pdf and I'm getting some strange results. I have created this small example to illustrate what I think is a bug:

Input is a FPDF_PAGE page with 116 annotations. If I run this code

FPDF_ANNOTATION annotation31 = FPDFPage_GetAnnot(page, 31);
FPDFAnnot_GetObject(annotation31, 2); 

FPDF_ANNOTATION annotation48 = FPDFPage_GetAnnot(page, 48);
FPDF_PAGEOBJECT pageObject2 = FPDFAnnot_GetObject(annotation48, 2);
FPDF_PAGEOBJECT formObject2 = FPDFFormObj_GetObject(pageObject2, 2);

FS_MATRIX matrix = {};
FPDFPageObj_GetMatrix(formObject2, &matrix); 

 then I get a different matrix compared to if I simply remove 

FPDF_ANNOTATION annotation31 = FPDFPage_GetAnnot(page, 31);
FPDFAnnot_GetObject(annotation31, 2); 

from the above code. It seems to me that FPDFAnnot_GetObject(annotation31, 2) will change the output from FPDFPageObj_GetMatrix used for a completely different annotation.


Lei Zhang

unread,
Jan 13, 2026, 1:47:26 PM (4 days ago) Jan 13
to Ann-Sofie, pdfium
Hi,

Is it the FPDFPage_GetAnnot(page, 31); call that's the issue, or the
FPDFAnnot_GetObject(annotation31, 2); call? This doesn't sound like an
issue that should be happening, as most getter functions are not
modifying data. If you suspect it's bug, please file a bug report on
https://crbug.com/pdfium/new and share a PDF to reproduce the issue if
possible.
> --
> 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/a9ab1d46-fc6f-4bad-9330-6eed88d8e5ecn%40googlegroups.com.

Ann-Sofie

unread,
Jan 14, 2026, 4:19:59 AM (3 days ago) Jan 14
to pdfium
Hi,

It's FPDFAnnot_GetObject(annotation31, 2); that makes changes to the matrix. I will create a bug report.

Thank you,

Ann-Sofie



Lei Zhang

unread,
Jan 14, 2026, 12:58:25 PM (3 days ago) Jan 14
to Ann-Sofie, pdfium
Thanks for filing crbug.com/475719025.

On Wed, Jan 14, 2026 at 1:20 AM 'Ann-Sofie' via pdfium
> To view this discussion visit https://groups.google.com/d/msgid/pdfium/581a9a54-ef89-4606-9a20-b76a64e9381fn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages