Skip to content

Instantly share code, notes, and snippets.

@lildata
Created July 9, 2017 06:01
Show Gist options
  • Save lildata/c10a1e6e5fd496f26808332d56895de8 to your computer and use it in GitHub Desktop.
Save lildata/c10a1e6e5fd496f26808332d56895de8 to your computer and use it in GitHub Desktop.
PDF
As seen on https://brendanzagaeski.appspot.com/0004.html
%PDF-1.1
%¥±ë
1 0 obj
<< /Type /Catalog
/Pages 2 0 R
>>
endobj
2 0 obj
<< /Type /Pages
/Kids [3 0 R]
/Count 1
/MediaBox [0 0 300 144]
>>
endobj
3 0 obj
<< /Type /Page
/Parent 2 0 R
/Resources
<< /Font
<< /F1
<< /Type /Font
/Subtype /Type1
/BaseFont /Times-Roman
>>
>>
>>
/Contents 4 0 R
>>
endobj
4 0 obj
<< /Length 55 >>
stream
BT
/F1 18 Tf
0 0 Td
(Hello World) Tj
ET
endstream
endobj
xref
0 5
0000000000 65535 f
0000000018 00000 n
0000000077 00000 n
0000000178 00000 n
0000000457 00000 n
trailer
<< /Root 1 0 R
/Size 5
>>
startxref
565
%%EOF
Header; specifies that this file uses PDF version 1.1
Comment containing at least 4 high bit characters. This example has 6.
Object 1, Generation 0
Begin a Catalog dictionary
The root Pages object: Object 2, Generation 0
End dictionary
End object
Object 2, Generation 0
Begin a Pages dictionary
An array of the individual pages in the document
The array contains only one page
Global page size, lower-left to upper-right, measured in points
End dictionary
End object
Object 3
Begin a Page dictionary
The resources for this page…
Begin a Font resource dictionary
Bind the name F1 to
a Font dictionary
It's a Type 1 font
and the font face is Times-Roman
The contents of the page: Object 4, Generation 0
Object 4
A stream, 55 bytes in length
Begin stream
Begin Text object
Use F1 font at 18 point size
Position the text at 0,0
Show text Hello World
End Text
End stream
The xref section
A contiguous group of 5 objects, starting with Object 0
Object 0: is object number 0, generation 65535, free, space+linefeed
Object 1: at byte offset 18, generation 0, in use, space+linefeed
The trailer section
The document root is Object 1, Generation 0 (the Catalog dictionary)
The document contains 5 indirect objects
Where is the newest xref?
byte offset 565
End of File
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment