Previous Next


                                    APPENDIX G


                      G   Example PDF Files

    This appendix presents several examples showing the structure of actual PDF
    files:

    • A minimal file that can serve as a starting point for creating other PDF files
      (and that is the basis of later examples)
    • A simple example that shows a text string—the classic “Hello World”—and a
      simple graphics example that draws lines and shapes
    • A fragment of a PDF file that illustrates the structure of the page tree for a large
      document and, similarly, two fragments that illustrate the structure of an out-
      line hierarchy
    • An example showing the structure of a PDF file as it is updated several times,
      illustrating multiple body sections, cross-reference sections, and trailers

    Note: The Length values of stream objects in the examples and the byte addresses in
    cross-reference tables are not necessarily accurate.


G.1 Minimal PDF File

    Example G.1 is a PDF file that does not draw anything; it is almost the minimum
    acceptable PDF file. It is not strictly the minimum acceptable because it contains
    an outline dictionary (Outlines in the document catalog) with a zero count (in
    which case this object would normally be omitted); a page content stream
    (Contents in the page object); and a resource dictionary (Resources in the page
    object) containing a ProcSet array. These objects were included to make this file
    useful as a starting point for creating other, more realistic PDF files.

    Table G.1 lists the objects in this example.


                                            1057

Previous Next