mirror of
https://github.com/michaelrsweet/pdfio.git
synced 2024-12-27 05:48:20 +01:00
Update pdfio.md
This commit is contained in:
parent
f5d40a305e
commit
2cadfd8a1e
14
doc/pdfio.md
14
doc/pdfio.md
@ -150,8 +150,8 @@ Since PDF files almost always contain binary data, they can become corrupted if
|
|||||||
%âãÏÓ
|
%âãÏÓ
|
||||||
|
|
||||||
### Body
|
### Body
|
||||||
- The file body consists of a sequence of objects, each preceded by an object number, generation number, and the obj keyword on one line, and followed by the endobj keyword on another.
|
The file body consists of a sequence of objects, each preceded by an object number, generation number, and the obj keyword on one line, and followed by the endobj keyword on another.
|
||||||
- For Example
|
- For Example:
|
||||||
'''
|
'''
|
||||||
1 0 obj
|
1 0 obj
|
||||||
<<
|
<<
|
||||||
@ -164,11 +164,11 @@ endobj
|
|||||||
- Here, the object number is 1, and the generation number is 0 (it almost always is). The content for object 1 is in between the two lines 1 0 obj and endobj. In this case, it’s the dictionary <</Kids [2 0 R] /Count 1 /Type /Pages>>
|
- Here, the object number is 1, and the generation number is 0 (it almost always is). The content for object 1 is in between the two lines 1 0 obj and endobj. In this case, it’s the dictionary <</Kids [2 0 R] /Count 1 /Type /Pages>>
|
||||||
|
|
||||||
### Cross-Reference Table
|
### Cross-Reference Table
|
||||||
- The cross-reference table lists the byte offset of each object in the file body.
|
The cross-reference table lists the byte offset of each object in the file body.
|
||||||
- This allows random access to objects, meaning they don't have to be read in order.
|
This allows random access to objects, meaning they don't have to be read in order.
|
||||||
- Objects that are not used are never read, making the process efficient.
|
Objects that are not used are never read, making the process efficient.
|
||||||
- Operations like counting the number of pages in a PDF document are fast, even in large files.
|
Operations like counting the number of pages in a PDF document are fast, even in large files.
|
||||||
- Each object has an object number and a generation number.
|
Each object has an object number and a generation number.
|
||||||
- Generation numbers are used when a cross-reference table entry is reused.
|
- Generation numbers are used when a cross-reference table entry is reused.
|
||||||
- For simplicity, we would assume generation numbers to be always zero and ignore them.
|
- For simplicity, we would assume generation numbers to be always zero and ignore them.
|
||||||
- The cross-reference table consists of:
|
- The cross-reference table consists of:
|
||||||
|
Loading…
Reference in New Issue
Block a user