Adobe 23101764 Scripting Guide - Page 72
Document object
UPC - 718659340025
View all Adobe 23101764 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 72 highlights
Scripting Photoshop 3 Document object // Get a reference to the file that we want to open var fileRef = new File( < a file path > ); // 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.constrainProportions = false; // Now open the file app.open( fileRef, pdfOpenOptions ); // restore unit settings app.preferences.rulerUnits = originalRulerUnits; Because Photoshop cannot save all of the format types that it can open, the open document types may be different from the save document types. 3.9 Document object After you target the Photoshop application, the next object you will likely target is the Document object. The Document object can represent any open document in Photoshop. For example, you could use the Document object to get the active layer, save the current document, then copy and paste within the active document or between different documents. 3.9.1 Saving documents and save options Photoshop lets you work with various file formats. It is important to note, however, that the Open and Save formats are not identical. Also note that some formats available in scripting require you to install optional file formats. The optional formats are: • Alias PIX • Electric Image • SGI RGB • Wavefront RLA • SoftImage Photoshop CS Scripting Guide 68