New Forum | Previous | Next | (P-PDF) Developers
Topic: Moving an object within a pdf
Conf: (P-PDF) Developers, Msg: 40944
Date: 5/24/2002 07:29 AM
What is the best way to move an object within a pdf?
For the sake of 'simplicity' let's say I want to move the 8th object of a pdf to the end of of the pdf (before the new xref). What exactly do I do to the original xref table's 8th object entry? Nothing? Recalculate all of the byte-offsets in the original xref?
I know I must add an xref table at the end of the pdf to make sure the reader knows where the 8th object has moved to, but I am unsure of exactly what I must do.
I have read the examples in the Adobe PDF reference but it mainly covered annotations and ended up confusing me.
For example, let's say this is the original pdf's xref table:
0000001234 00000 n <-- 8th object
Do I have to declare this as a free object? What do I have to do to this entry to make sure it doesn't break anything referencing the 8th object?
And here is what I'm assuming I have to add at the end of the pdf:
0000000000 65535 f
0000004321 00000 n <-- new location of 8th object
/Prev 2345 <-- location of the first xref
4567 <-- location of the new xref
Is this correct? (disregarding my bogus offsets, of course :)
Any help or comments would be greatly appreciated.