empira / PDFsharp-1.5

A .NET library for processing PDF
MIT License
1.28k stars 588 forks source link

ObjectID is not internal PDF ObjectID depending on PDF open mode #111

Closed jgunter7 closed 1 year ago

jgunter7 commented 4 years ago

For example, when I open a Form-Fill PDF, take this as an example: https://www.irs.gov/pub/irs-pdf/f1040.pdf

Depending on if I use PdfDocumentOpenMode.Modify, or PdfDocumentOpenMode.ReadOnly, a specific field I am looking for has a different ObjectID. Note, I get the correct Object ID when using "ReadOnly" mode.

I am viewing ObjectID's using CosEdit, and I can reproduce this issue when printing out the AcroForm field ObjectID's when opening the PDF file in different modes.

ThomasHoevel commented 1 year ago

This is by design. Objects should be addressed by Name, not by ID.