140
10
Working with Pref light
Preflight is a way to verify that you have all required files, fonts, assets (e.g., placed images and PDF files),
printer settings, trapping styles, etc., before you send a publication to an output device. For example, if you
placed an image as a low-resolution proxy but do not have the high-resolution original image accessible
on your hard disk (or workgroup server), that may result in an error during the printing process. Preflight
checks for this sort of problem.
It can be run in the background as you work.
This chapter demonstrates how to interact with the preflight system using scripting. For illustration
purposes, we show how to configure preflight to raise an error if the page size is something other than
letter size (8.5" x 11"). We briefly highlight how it is done in the user interface, then show how to achieve
the same results through scripting.
We assume you already read Adobe InDesign CS5 Scripting Tutorial and know how to create, install, and run
a script.
Exploring Preflight Profiles
InDesign’s preflight feature is profile based, rule driven, and parameterized. There might be one or more
preflight profiles. Initially, there is one profile, [Basic], which is read-only; you cannot modify or delete it.
A preflight profile contains many preflight rules. Each rule has a name and multiple data objects. Each data
object has a name, data type, and data value. The data value can be changed. Each rule can be configured
as follows:
X Disabled — The preflight rule is disabled.
X Return as error — The preflight rule returns error-level feedback.
X Return as warning — The preflight rule returns warning-level feedback.
X Return as informational — The preflight rule returns informational-level feedback.
To check the profile in InDesign, choose Preflight Panel > Define Profiles. You also can get profile
information by scripting.
Listing preflight profiles
This script fragment shows how to list all preflight profiles. For the complete script, see ListPreflightProfiles.
var profiles = app.preflightProfiles;
var profileCount = profiles.length;|
var str = "Preflight profiles: ";
for (var i = 0; i < profileCount; i++)
{
if (i != 0)
{
str += ", ";
}
str += profiles.item(i).name;
}
alert(str);