In order to give you a better idea of what's actually "under the hood" of Moonshine2, the script is included below, along with comments for each line as appropriate.
// This opens each of the found PDFs ([i] is the iteration, or individual
// file) using a set of pdfOpenOptions
// To modify the PDF Open Options
// create a new PDFOpenOptions setting:
var pdfOpenOptions = new PDFOpenOptions();
// constrain the proportions such that a scaled file, based on the
// width requested is generated
pdfOpenOptions.constrainProportions = true;
// This sets the width of the resulting image
pdfOpenOptions.width = request.WidthOfOutputJPEG;
// open as an RGB image; other alternatives include Grayscale and CMYK
pdfOpenOptions.mode = OpenDocumentMode.RGB;
// this is the requested DPI
pdfOpenOptions.resolution = request.DPIOfOutputJPEG;
// These settings are passed into the open command as used above.
// To modify the JPEG save Options; the color space and DPI are in the
// document as determined by the PDF open options above.
// create a new JPEGSaveOptions setting as used in the save command
jpgSaveOptions = new JPEGSaveOptions();
// quality of JPEG output in a scale of 1 to 12 (lowest to highest quality)
jpgSaveOptions.quality = request.QualityOfOutputJPEG;
// Once open, the next step is to save the JPEG:
app.activeDocument.saveAs(saveFile, jpgSaveOptions, true, Extension.LOWERCASE);
// This simply saves the open document as a JPEG
// To wrap script into Windows:
Left to the Reader
JPEG is just one of many output formats supported by Photoshop CS. This script could save TIFF, GIF, Targa or many of the formats that Photoshop supports. Other additions could be the addition of watermarks prior to saving as an image for protection.
Adobe engineers scripting as a core part of the applications -- realizing that many customers will need alter the software in ways specific to their environments. Making your own Distillery is still legal -- at least with scripting.
Nick Hodge, from Adobe Systems in Australia, is attempting to become an Adobe renaissance man. Sales by day, scripting by night.
This article appeared in its original form at nickhodge.com. It has been updated by the author and reproduced with permission.
OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.