Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PDF Indirect references and incremental updates

Tags:

pdf

Reading the PDF 1.7 reference, I'm wondering about this quote on page 99:

When a consumer application read the file, it must build its cross-reference information in such a way that the most recent copy of each object is the one accessed in the file.

Let's say a dictionary (3 0 obj) references an indirect object 4 0 R. What if you incrementally update this object to make 4 1 obj? When the PDF-reading application reads the reference 4 0 R of 3 0 obj, but only has information about 4 1 obj in its internal xref table - is it still correct to use the 4 1 obj? Or do you have to update all the referencing objects when updating an indirect object?

like image 451
Ploppz Avatar asked Jan 22 '26 05:01

Ploppz


1 Answers

“PDF 32000-1:2008 - 7.3.10 Indirect Objects” declares:

[…] Together, the combination of an object number and a generation number shall uniquely identify an indirect object. […]

You must not update a generation number if you update an object! A generation number update can only occur if the object is deleted as described in “PDF 32000-1:2008 - 7.5.4 Cross-Reference Table”:

[…] When an indirect object is deleted, its cross-reference entry shall be marked free […]. The entry’s generation number shall be incremented by 1 to indicate the generation number to be used the next time an object with that object number is created.

like image 154
Jan Slabon Avatar answered Jan 23 '26 19:01

Jan Slabon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!