Pajdeg
0.2.2
Pajdeg
|
This demonstrates what the modifications Pajdeg make to a PDF end up looking like, byte-wise. You can check this out yourself by doing diff -a
on the original and new PDF files after using Pajdeg.
First off, we see a number of lines added to the new PDF that weren't in the old one. It's an object (ID 21, generation number 0) with a stream whose length is 12 bytes, and the stream itself consists of the 12 characters "Hello World!".
Next up we see a replaced PDF dictionary. If you look closer, you'll notice that the only change is that /Metadata 21 0 R
was added to the new PDF.
At the very top, 0 21
is replaced with 0 22
. This is the XREF (cross reference) header, which is changed because the PDF has an extra object (our metadata object). This follows by a chunk of lines being replaced. These are XREF entries, and almost all of them have been updated, because almost every single object's byte position in the PDF has changed. That's unfortunate but normal. It can be alleviated to some extent when making small modifications by opting for the PDParserCreateAppendedObject() method over PDParserCreateNewObject(), but shouldn't be thought too hard into.
Next up is the trailer object which has been updated as well: /Size
has been set to 22, because we now have 22 objects in the PDF.
That's the whole diff. Chances are you won't get quite as clean results, because the original PDF here originated from Pajdeg, which often is not the case.
Back to Adding metadata to a PDF