CHAPTER 3
106
Syntax
3.4.7 Cross-Reference Streams
Beginning with PDF 1.5, cross-reference information may be stored in a
cross-
reference stream
instead of in a cross-reference table. Cross-reference streams
provide the following advantages:
•
A more compact representation of cross-reference information
•
The ability to access compressed objects that are stored in object streams (see
to be added in the future
Cross-reference streams are stream objects (see Section 3.2.7, “Stream Objects”),
and contain a dictionary and a data stream. Each cross-reference stream contains
the information equivalent to the cross-reference table (see Section 3.4.3, “Cross-
reference section. The trailer dictionary entries are stored in the stream
dictionary, and the cross-reference table entries are stored as the stream data, as
shown in the following example:
Example 3.10
...
objects
...
12 0 obj
<< /Type /XRef
/Size ...
/Root ...
>>
stream
...
endstream
endobj
...
more objects
...
startxref
byte_offset_of_cross-reference_stream
% Points to object 12
%%EOF
% Cross-reference stream
% Cross-reference stream dictionary
% Stream data containing cross-reference information
Note that the value following the
startxref
keyword is now the offset of the cross-
reference stream rather than the
xref
keyword. (See implementation note 21 in