
11
List of Examples
Example 4.1
Creating a new PDF document...................................................................................................................................63
Example 4.2
Creating a new page.......................................................................................................................................................63
Example 4.3
Creating a PDEContent object ....................................................................................................................................64
Example 4.4
Acquiring a font that is used to draw text on a page .........................................................................................64
Example 4.5
Creating a PDEGraphicState object ..........................................................................................................................65
Example 4.6
Creating an ASFixedMatrix object .............................................................................................................................65
Example 4.7
Inserting text into a PDF document..........................................................................................................................66
Example 4.8
Saving a PDF document ................................................................................................................................................67
Example 4.9
Examining a PDF Library applicati
on so
urce file .................................................................................................68
Example 5.1
Opening a PDF file...........................................................................................................................................................73
Example 5.2
Opening a PDF document in an external window ..............................................................................................80
Example 5.3
Creating a PDDoc object...............................................................................................................................................84
Example 5.4
Creating a PDDoc object based on an open PDF document...........................................................................85
Example 5.5
Accessing a non-PDF file...............................................................................................................................................85
Example 6.1
Adding a menu command to an existing menu ..................................................................................................91
Example 6.2
Adding a menu command to a new menu ............................................................................................................92
Example 6.3
Creating menu callback functions.............................................................................................................................94
Example 7.1
Retrieving a toolbar by name......................................................................................................................................99
Example 7.2
Creating a toolbar button.......................................................................................................................................... 100
Example 7.3
Setting a button’s help text ...................................................................................................................................... 101
Example 7.4
Setting a button’s label text...................................................................................................................................... 102
Example 7.5
Retrieving existing toolbar buttons ....................................................................................................................... 103
Example 7.6
Attaching a button to a toolbar .............................................................................................................................. 104
Example 7.7
Exposing a button in a web browser..................................................................................................................... 104
Example 7.8
Removing a button from a toolbar ........................................................................................................................ 105
Example 7.9
Creating a toolbar button callback function ...................................................................................................... 106
Example 8.1
Creating text annotations.......................................................................................................................................... 109
Example 8.2
Retrieving existing annotations .............................................................................................................................. 110
Example 8.3
Modifying a text annotation..................................................................................................................................... 112
Example 9.1
Creating bookmarks .................................................................................................................................................... 114
Example 9.2
Assigning an action to a bookmark ....................................................................................................................... 116
Example 9.3
Opening a bookmark .................................................................................................................................................. 117
Example 9.4
Retrieving the root bookmark.................................................................................................................................. 118
Example 9.5
Retrieving a specific bookmark ............................................................................................................................... 118
Example 9.6
Retrieving existing bookmarks ................................................................................................................................ 119
Example 9.7
Deleting a bookmark................................................................................................................................................... 121