Previous Next


                                              178
     CHAPTER 3                                                                       Syntax



     Errors in Type 4 Functions

     The code that reads a type 4 function (analogous to the PostScript scanner) must
     detect and report syntax errors. It may also be able to detect some errors that will
     occur when the function is used, although this is not always possible. Any errors
     detected by the scanner are considered to be errors in the PDF file and are
     handled like other errors in the file.

     The code that executes a type 4 function (analogous to the PostScript interpreter)
     must detect and report errors. PDF does not define a representation for the
     errors; those details are provided by the application that processes the PDF file.
     The following types of errors can occur (among others):

     • Stack overflow
     • Stack underflow
     • A type error (for example, applying not to a real number)
     • A range error (for example, applying sqrt to a negative number)
     • An undefined result (for example, dividing by 0)

3.10 File Specifications

     A PDF file can refer to the contents of another file by using a file specification
     (PDF 1.1), which can take either of two forms:

     • A simple file specification gives just the name of the target file in a standard for-
       mat, independent of the naming conventions of any particular file system. It
       can take the form of either a string or a dictionary
     • A full file specification includes information related to one or more specific file
       systems. It can only be represented as a dictionary.

     Although the file designated by a file specification is normally external to the
     PDF file referring to it, PDF 1.3 permits a copy of the external file to be
     embedded within the referring PDF file, allowing its contents to be stored or
     transmitted along with the PDF file. However, embedding a file does not change
     the presumption that it is external to the PDF file. Consequently, to ensure that
     the PDF file can be processed correctly, it may be necessary to copy its embedded
     files back into a local file system.

Previous Next