iv Contents Adobe InDesign CS2 Scripting Guide
Exporting a document as PDF ..............................................................................104
Using current PDF export options ................................................................................. 104
Setting PDF export options ............................................................................................. 104
Exporting a range of pages ............................................................................................. 106
Exporting pages separately ............................................................................................. 106
Exporting pages as EPS ...........................................................................................107
Exporting all pages ............................................................................................................. 108
Exporting a range of pages ............................................................................................. 108
Exporting with file naming .............................................................................................. 108
6 Working with Documents in JavaScript ...............111
Basic document management ............................................................................. 112
Creating a new document .................................................................................................112
Opening a document ..........................................................................................................112
Closing a document .............................................................................................................112
Saving a document ..............................................................................................................113
Basic page layout ...................................................................................................... 114
Defining page size and document length ...................................................................114
Defining bleed and slug areas .........................................................................................114
Setting page margins and columns ...............................................................................115
Changing the pasteboard's appearance ........................................................... 117
Using guides and grids ............................................................................................ 117
Defining guides .....................................................................................................................117
Setting grid preferences ....................................................................................................119
Snapping to guides and grids ..........................................................................................119
Changing measurement units and ruler ........................................................... 119
Defining and applying document presets .......................................................120
Creating a preset by copying values .............................................................................120
Creating a preset using new values ...............................................................................121
Using a preset ........................................................................................................................122
Setting up master spreads .....................................................................................122
Setting text-formatting defaults ..........................................................................123
Setting application text defaults ....................................................................................123
Setting the active document's defaults .......................................................................126
Using text defaults ...............................................................................................................126
Adding XMP metadata ............................................................................................126
Creating a document template ............................................................................127
Printing a document ................................................................................................130
Printing using page ranges ...............................................................................................130
Setting print preferences ...................................................................................................130
Using printer presets ...........................................................................................................133
Creating printer presets from printing preferences .................................................133
Exporting a document as PDF ..............................................................................138
Using current PDF export options ..................................................................................138
Setting PDF export options and exporting pages separately .............................139
Exporting a range of pages ..............................................................................................141
Exporting pages as EPS ........................................................................................... 141
Exporting all pages ..............................................................................................................141
Exporting a range of pages ..............................................................................................141
Controlling export options ...............................................................................................142