in reply to Re: Calculated position incorrect when using regex in text file that also contains binary info
in thread Calculated position incorrect when using regex in text file that also contains binary info
You're absolutely correct. At the end of a PDF file, there's a size section indicated by /Size <nr_of_cos_objects> that informs you how many x 0 obj there are in the PDF file. COS = Carousel Object System and refers to the original code used by Adobe (not used anymore as such, though...).
Just before that section, there's a "table" that tells you how many bytes (= offset) there are from the beginning of the file to a certain block, like so:
What you see here is the total amount of COS objects (7139 in this case, which is repeated later on within a separate section indicated with /Size, like I explained above), followed by the "table" that indicates the offset of every block, starting from 0 (this one can and should be ignored, since there's no COS starting with 0 itself).endobj xref 0 7139 0000000000 65535 f 0000000015 00000 n 0000012681 00000 n 0000025600 00000 n 0000058867 00000 n 0050527288 00000 n 0000023513 00000 n 0000020738 00000 n 0000018831 00000 n 0000016437 00000 n 0000012809 00000 n 0050520688 00000 n 0050527008 00000 n 0000000484 00000 n
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Calculated position incorrect when using regex in text file that also contains binary info
by jcb (Parson) on Jun 17, 2020 at 23:40 UTC |