Skip to content

Instantly share code, notes, and snippets.

@grefel
Last active January 27, 2016 10:44
Show Gist options
  • Save grefel/b7b954b36e06f72a78f2 to your computer and use it in GitHub Desktop.
Save grefel/b7b954b36e06f72a78f2 to your computer and use it in GitHub Desktop.
Activate Prefilight Profile
preflight(app.documents[0], "pdfCheck");
function preflight(dok, pprofilName) {
var prefligthProfile = app.preflightProfiles.itemByName(pprofilName);
if (!prefligthProfile.isValid) {
var profilePath = new File ("/pathToProfil/pdfCheck.idpp")
if (!profilePath.exists) {
alert("Das Preflight Profil pdfCheck.idpp nicht gefunden");
return;
}
else {
prefligthProfile = app.loadPreflightProfile(profilePath);
}
}
var preflightResult = "";
// Preflight
var preflightProcess = app.preflightProcesses.add(dok, prefligthProfile);
preflightProcess.waitForProcess();
var results = preflightProcess.processResults;
if (!results.indexOf("None") == 0) {
preflightResult += "Es sind Fehler beim Preflight aufgetreten. Bitte prüfen Sie die Datei!\n\n" + results + "\n";
}
preflightProcess.remove();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment