Brandt Solovij
Brandt Solovij

Reputation: 2134

Do Indirect Objects need to be in numerical order?

I'm trouble shooting some issues with PDF documents and one of the things some PDFs seem to have is incorrect sequencing and large numerical gaps in the ordering (top down) of "indirect objects"

That is to say, for example, I have a PDF that is structured like this:

%PDF-1.6
300 0 obj 
<< indirect object >>
endObj
313 0 obj 
<< indirect object >>
endObj
307 0 obj 
<< indirect object >>
endObj

..... et c... 

a handful of indirect objects with identifiers composed of 3 digits, say 300 - 320 for our purposes. These are out of order within their own 300-320 range. Somewhere in this jumble is a well formed %%EOF as well

..... then a numerically sequenced series starts. We'll say 1 thru 100

1 0 obj 
<< indirect object >>
endObj
2 0 obj 
<< indirect object >>
endObj
3 0 obj 
<< indirect object >>
endObj

.... and so on, eventually ended with an EOF sequence :

startxref
116
%%EOF

to add a twist. The sequence of 1-100 is in correct numerical order, unlike the haphazard "grab bag" order of the preceding 300-320 segment. And id #s between 101 thru 299 are not at all even present in the document

One more twist : This document has remained unchanged for over a year, and recently (last several days), Adobe Reader is unable to view the file as it is "damaged and unable to be repaired"

Thanks in advance!

Upvotes: 0

Views: 79

Answers (1)

Brandt Solovij
Brandt Solovij

Reputation: 2134

Found it in the spec.

3.2.9 Indirect Objects

A positive integer object number. Indirect objects are often numbered sequentially within a PDF file, but this is not required; object numbers may be assigned in any arbitrary order

http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/pdf_reference_1-7.pdf

Upvotes: 1

Related Questions