Last active
January 27, 2016 10:44
-
-
Save grefel/b7b954b36e06f72a78f2 to your computer and use it in GitHub Desktop.
Activate Prefilight Profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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