- Getting Started
- Memory Usage
- Readers and Writers
- The Document Class
- Page Layout and Mode
- Viewer Preferences
- Document Outline
- Page Labels
- Embedded File Streams
- Colors and Color Spaces
- Page Formats and Boundaries
- Standard and Public Key Encryption
- Fonts and Encodings
- Corrupted Documents
- Reader Enabled Documents
- Refactor Old SetaPDF Code
- API Reference
A destination in a PDF document defines a particular view of a page, the location of the document window on that page, and a zoom factor.
A destination is represented by the SetaPDF_Core_Document_Destination class. This class offers some methods to evaluate a destination and let you resolve its target page in an easy way:
Get the target page object.
Get the target page number.
The class also comes with several static methods that let you create or find a destination by a name:
Creates a destination by a page object.
Creates a destination by page number.
Creates an explicit Destination array.
Find a destination by a name.
As a destination is related to a page the easiest way to create one is to use one of the provided helper methods: SetaPDF_Core_Document_Destination or SetaPDF_Core_Document_Destination. Internally both of these methods will create the needed destination array by calling the SetaPDF_Core_Document_Destination method. All arguments passed to one of the helper methods will also be forward to this method (e.g. the fit-mode). The default fit-mode is set to "fit".
It is also possible to define the position and zoom factor of the destination by a specific fit-mode:
Destinations are represented in PDF by a simple array structure which can be used as a value in structures that allow a destination value. In addition it is also allowed to use named destinations which are represented by a simple string value. The destination array related to this named destination is saved in a documents name tree. This tree will be used to look-up for these named destinations. Internally the SetaPDF_Core_Document_Destination method makes use of a documents name tree to resolve the destination appropriate.