Exporting A Range Of Pages; Exporting Pages Separately - Adobe 27510753 - InDesign CS2 - PC Manual

Scripting guide
Hide thumbs Also See for 27510753 - InDesign CS2 - PC:
Table of Contents

Advertisement

172
Working with Documents in VBScript
.BleedMarks = False
End If
.ColorBars = True
Rem ColorTileSize and GrayTileSize are only used when
Rem the export format is set to JPEG2000.
Rem .ColorTileSize = 256
Rem .GrayTileSize = 256
.CropMarks = True
.OmitBitmaps = False
.OmitEPS = False
.OmitPDF = False
.PageInformationMarks = True
.PageMarksOffset = 12
.PDFColorSpace = idPDFColorSpace.idUnchangedColorSpace
.PDFMarkType = idMarkTypes.idDefault
.PrinterMarkWeight = idPDFMarkWeight.idP125pt
.RegistrationMarks = True
On Error Resume Next
.SimulateOverprint = False
On Error GoTo 0
.UseDocumentBleedWithPDF = True
Rem Set viewPDF to true to open the PDF in Acrobat or Adobe Reader.
.ViewPDF = False
End With
Rem Now export the document. You'll have to fill in your own file path.
myInDesign.ActiveDocument.Export idExportFormat.idPDFType, "c:\myTestDocument.pdf", False

Exporting a range of pages

The following example shows how to export a specified page range as PDF:
Rem ExportPageRangeAsPDF.vbs
Rem An InDesign CS2 VBScript.
Rem Exports a range of pages to a PDF file.
Set myInDesign = CreateObject("InDesign.Application.CS2")
Rem Enter the names of the pages you want to export in the following line.
Rem Note that the page name is not necessarily the index of the page in the
Rem document (e.g., the first page of a document whose page numbering starts
Rem with page 21 will be "21", not 1).
myInDesign.PDFExportPreferences.PageRange = "1-3, 6, 9"
Rem Fill in your own file path.
myFile = "c:\myTestFile.pdf"
myInDesign.ActiveDocument.Export idExportFormat.idPDFType, myFile, False

Exporting pages separately

The following example exports each page from a document as an individual PDF file:
Rem ExportEachPageAsPDF.vbs
Rem An InDesign CS2 VBScript
Rem Exports each page of an InDesign CS document as a separate PDF to
Rem a selected folder using the current PDF export settings.
Set myInDesign = CreateObject("InDesign.Application.CS2")
Set myFileSystemObject = CreateObject("Scripting.FileSystemObject")
If myInDesign.Documents.Count <> 0 Then
Set myDocument = myInDesign.ActiveDocument
Rem VBScript doesn't have a native "get folder" statement, so we'll use
Rem InDesign's JavaScript to display a folder browser.
myJavaScript = "myFolder = Folder.selectDialog(""Choose a Folder""); myFolderName = myFolder.
fsName;"
Rem Run the string "myJavaScript" as a JavaScript
myFolderName = myInDesign.DoScript(myJavaScript, idScriptLanguage.idJavascript)
If myFileSystemObject.FolderExists(myFolderName) Then
myExportPages myInDesign, myDocument, myFolderName
End If
Adobe InDesign CS2 Scripting Guide

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Indesign cs2

Table of Contents