{oapdf_gg}
Office software is closely linked to the PDF,the PDF is also must have to control!      Set home Page  Add to Favorites  
You are here:Home > PDF Application > PDF Development
PDF Development
Analysis of the structure of PDF documents
Finishing by: Date:2009-04-17 21:20:49 Popularity: Tags:

5. PDF of the basic syntax:
Paper is the first line of the first document, the document specified by the PDF specification to comply with the version number, which appears in the first line of PDF documents.
The first line of an object in general there are two numbers and the keyword "obj". For example:

3 0 obj
<<

/Type/Pages
/Count 1
/Kids [4 0 R]
>>

endobj

The first number is called the target number to uniquely identify an object, the second is the number, is to show that it was created after several revisions, all the newly created PDF document is the object of its should be 0 that was created after the first has not been modified. The above example shows that the object on the target number is 3, but has not been created after the changes have been made.
The contents of the object should be included in the <> between, and finally to the end of endobj keywords.

6. Hello World document file analysis:
6.1. A detailed analysis of documents
% PDF-1.0
Paper first shows that PDF1.0 specification in line with

1 0 obj
<<

/Type/Catalog
/Pages 3 0 R
/Outlines 2 0 R
>>

endobj
Catalog Object (the root object)

2 0 obj
<<

/Type/Outlines
/Count 0
>>

endobj
outline the object (in this case it counts for 0, explaining that it did not bookmark)

3 0 obj
<<

/Type/Pages
/Count 1
/Kids [4 0 R]
>>

endobj
target pages (the page group object),/Type/Pages that own the properties, the type of object for the page,/Count 1 that the number of page 1,/Kids [4 0 R] Help page for 4, to be described here if there are multiple pages, multiple pages on a row go directly, for example,/Kids [4 0 R 10 0 R], shows that the PDF on the first page of the target number is 4, the second page of the target number is 10 .

4 0 obj
<<

/Type/Page
/Parent 3 0 R
/Resources <>/ProcSet 6 0 R>>
/MediaBox [0 0 612 792]
/Contents 5 0 R
>>

endobj
Page object,/Parent 3 0 R that the object of his father, the target number is 3,/Resources <>/ProcSet 6 0 R>> note to be included in the page resources, including the type of fonts and content,/MediaBox [0 0 612 792] that the display page size (in pixel units),/Contents 5 0 R that the object of the page content object No. 5.

5 0 obj
<>
stream
BT
/F1 24 Tf
100 100 Td (Hello World) Tj
ET
endstream
endobj

<> Description byte stream for a few, from BT to start, ET the end, including at the end of the middle line.
Stream note the beginning of a stream object.
BT notes the beginning of a text object.
/F1 24 Tf, Tf Description True font objects, font specified for the F1, the size of 24 pixels.
100 150 Td (Hello World) Tj, 100 100 lines of text describing the location of placement, for Td, we can interpret it this way, our current X, Y coordinates, respectively, 100 and 150 is coupled with the location of the text, as in the case There is only one object, then it is the position (100,150), if the next target location information for 100, 50 Td, then it is the location should be (100 +100, 150 +50) is (200,200). (Hello World) Tj note the contents of the text, of course, if this is the contents of the text can be written in 16-band, with <> contains.
ET the end of the object caption
the end of stream endstream object

6 0 obj
[/PDF/Text]
Endobj
[/PDF/Text] note the contents of the type of PDF as text only, if there is picture [/PDF/Image]

7 0 obj
<<

/Type/Font
/Subtype/Type1
/Name/F1
/BaseFont/Helvetica
>>

endobj
Object six defines the
Font object, make no explanation.

there isArticle InformationsComment Information
Category column

Site Help | Site Map | Feedback |
OAPDF.COM Copyright 2009 V1.1