Esko Logo Back to Esko Support
Choose your language for a machine translation:


Description

I want to export my PDF files created by Automation Engine to TIFF, but there is no task that helps me to do so. I can use the scriptrunner to script Adobe® Photoshop® to open and export my PDF files to TIFF.

There are some limitations. During the import of the PDF in Adobe® Photoshop®, spot colors will be converted to CMYK using the document profile. There is no way to keep your spot colors when using Adobe® Photoshop® to Export to TIFF.

It is possible to use alternative colorspaces during import: CMYK, RGB, Grayscale and Lab.

Procedure

You need to have a dedicated machine on which the Automation Engine Script Runner and Adobe® Photoshop® will be installed.

  1. Install the scriptrunner on the host machine.
  2. open the Automation Engine Pilot and go to Tools > Configure and set up the connection to the remote script runner host.
  3. Create either an Applescript, Extended Script or batch script.
  4. Select the script in the Script Runner task and apply it to a workflow.

Example scripts 

Applescript

(**

 * Sample scripts are provided as-is with no warranty of fitness for a particular purpose.

 * These scripts are solely intended to demonstrate techniques for accomplishing common tasks.

 * Additional script logic and error-handling may need to be added to achieve the desired results in your specific environment.

 *

 * It is up to the user to verify that his intended use of the offered automation functionality is compliant with any third party license agreement and/or other restrictions applicable to any non-Esko products.

 *)

--samplescript to export PDF to TIFF using Adobe® Photoshop®

on main(inputs, outputFolder, params)
set outputFolderReference to POSIX file outputFolder
repeat with input in inputs

log "Reading inputfile"
set inputReference to POSIX file input
log "Running script"
tell application "Adobe Photoshop CC 2015"

with timeout of 300 seconds

set openOptions to {class:PDF open options, mode:CMYK}
set saveOptions to {class:TIFF save options, image compression:none, byte order:IBM PC, save alpha channels:true, save spot colors:true, embed color profile:true} 
open alias inputReference as PDF with options openOptions --(showing, dialogs / never)
set theDocument to current document
save theDocument in file outputFolderReference as TIFF with options saveOptions
close current document saving no

end timeout

 end tell
log "File done (Everything converted to CMYK)"

end repeat
log "Script done"
return "OK"
end main

JavaScript

/**
* Sample scripts are provided as-is with no warranty of fitness for a particular purpose.
* These scripts are solely intended to demonstrate techniques for accomplishing common tasks.
* Additional script logic and error-handling may need to be added to achieve the desired results in your specific environment.
*
* It is up to the user to verify that his intended use of the offered automation functionality is compliant with any third party license agreement and/or other restrictions applicable to any non-Esko products.
*/

function main(inputs, outputFolder, params)
{
	//Call constructor for PDFOpenOptions
	pdfOpenOptions = new PDFOpenOptions;
	//specify the open options
	pdfOpenOptions.antiAlias = true;
	pdfOpenOptions.mode = OpenDocumentMode.CMYK; 
	//Call constructor for TiffSaveOptions;		
	tiffSaveOptions = new TiffSaveOptions();
	//specify save options
	tiffSaveOptions.alphachannels = true;
	tiffSaveOptions.annotations = false;
	tiffSaveOptions.byteOrder = ByteOrder.IBM;
    tiffSaveOptions.embedColorProfile = true;
	tiffSaveOptions.spotColors = true;
	tiffSaveOptions.transparency = true;
	var fileRef;
	var docRef;
	var outputFile;		
    for (i=0;i<inputs.length;i++)
    {
        fileRef = new File(inputs[i]);
		docRef = app.open(fileRef,pdfOpenOptions);      
        outputFile = new File(outputFolder + "/" + fileRef.name);
        docRef.saveAs(outputFile, tiffSaveOptions, true, Extension.LOWERCASE);
        docRef.close(SaveOptions.DONOTSAVECHANGES);
    }

    return "OK"
}

More information about scripting Adobe® Photoshop® can be found on:
http://www.adobe.com/devnet/photoshop/scripting.html 

Article information
Applies to

Automation Engine 12 and newer

Created

 

Last revised
AuthorLEFR
Case Number
Contents