Minimal PDF: Adobe PDF Specification ("ISO Approved Copy of The ISO 32000-1 Standards Document") Tips
Minimal PDF: Adobe PDF Specification ("ISO Approved Copy of The ISO 32000-1 Standards Document") Tips
Most PDF files do not look readable in a text editor. Compression, encryption, and embedded images are largely to blame. After removing these three components, one can
more easily see that PDF is a human-readable document description language.
The Adobe PDF specification (“ISO approved copy of the ISO 32000-1 Standards document”) includes an example “minimal PDF file,” but it's possible to trim it down
even further. The trickiest part is making sure that all the byte counts are correct (tips).
The file
%PDF-1.1 Header; specifies that this file uses PDF version 1.1
%¥±ë Comment containing at least 4 “high bit” characters. This example has 6.
3 0 obj Object 3
<< /Type /Page Begin a Page dictionary
/Parent 2 0 R
/Resources The resources for this page…
<< /Font Begin a Font “resource dictionary”
<< /F1 Bind the name “F1” to
<< /Type /Font a Font dictionary
/Subtype /Type1 It's a Type 1 font
/BaseFont /Times-Roman and the font face is Times-Roman
>>
>>
>>
/Contents 4 0 R The contents of the page: Object 4, Generation 0
>>
endobj
4 0 obj Object 4
<< /Length 55 >> A stream, 55 bytes in length
stream Begin stream
BT Begin Text object
/F1 18 Tf Use “F1” font at 18 point size
0 0 Td Position the text at 0,0
(Hello World) Tj Show text “Hello World”
ET End Text
endstream End stream
endobj
Download
Notes
The high bit comment in this example contains 6 one-byte characters. These happen to show up as 3 two-byte characters when viewing the file as UTF-8 encoded text. To
see 6 characters, try changing your browser's character encoding to “Western.”
Differences from the minimal PDF file in the Adobe spec.
Links
http://blog.idrsolutions.com/?s=%22Make+your+own+PDF+file%22
A series of posts that explains how to write PDF files from scratch.
For a gentler introduction to the specification, read some tips on writing a PDF file (this site) or an introduction to PDF (another site).
Found a mistake?
License
Updates
14 Mar 2019 Correct download links for the PDF files that include license comments.
02 Dec 2018 Add MIT License because placing in the public domain is not supported in all jurisdictions.
03 May 2014 Add note about 6 high bit characters appearing as 3 UTF-8 characters. Thanks @pdfkungfu!
2012 Jan 08 Comments link
The file was not working in some readers (including Adobe Reader!) because the Contents stream needed to be an indirect object. “All streams
2012 Dec 24
shall be indirect objects”
2012 Jun 15 Reword download link
2012 Jan 26 remove document trapdoor tech talk link. it seems off-topic.
2010 Dec 02 link to Google Tech Talk
2010 Nov 20 clean up
2010 Sep 27 Small changes, corrections
2010 Sep 13 Created