Adobe photoshop cs 2.0 User Guide

Page of 91
Photoshop CS2
Adobe Photoshop CS2  Scripting Guide
 Scripting Photoshop CS2     44
'Create a PDF option object
Dim pdfOpenOptionsRef 
Set pdfOpenOptionsRef = CreateObject("Photoshop.PDFOpenOptions")
pdfOpenOptionsRef.AntiAlias = True
pdfOpenOptionsRef.Height = 100
pdfOpenOptionsRef.Width = 200
pdfOpenOptionsRef.mode = psOpenRGB
pdfOpenOptionsRef.Resolution = 72
pdfOpenOptionsRef.Page = 3
pdfOpenOptionsRef.ConstrainProportions = False
' open the file
Dim docRef 
Set docRef = appRef.Open(C:\\PDFFiles\MyFile.pdf, pdfOpenOptionsRef)
'Restore unit setting
appRef.Preferences.RulerUnits = originalRulerUnits
JS
// Set the ruler units to pixels 
var originalRulerUnits = app.preferences.rulerUnits 
app.preferences.rulerUnits = Units.PIXELS 
// Get a reference to the file that we want to open 
var fileRef = new File( C:\\PDFFiles\MyFile.pdf ) 
// Create a PDF option object 
var pdfOpenOptions = new PDFOpenOptions 
pdfOpenOptions.antiAlias = true 
pdfOpenOptions.height = 100 
pdfOpenOptions.width = 200 
pdfOpenOptions.mode = OpenDocumentMode.RGB 
pdfOpenOptions.resolution = 72 
pdfOpenOptions.page = 3 
pdfOpenOptions.constrainProportions = false 
// open the file 
app.open( fileRef, pdfOpenOptions ) 
// restore unit settings 
app.preferences.rulerUnits = originalRulerUnits 
Saving a Document
Options for saving documents in Photoshop CS2 are illustrated below. To find out which properties you 
can specify for a specific file format save option, look up the object that begins with the file format name. 
For example, to find out about properties for saving an 
.eps
 file, do the following:
In the Adobe Photoshop CS2 AppleScript Scripting Reference, look up the 
Class EPS save options
.
In the Adobe Photoshop CS2 Visual Basic Scripting Reference and Adobe Photoshop CS2 JavaScript 
Scripting Reference
, look up 
EPSSaveOptions
.