I’ve been banging my head against the wall on this for awhile and I can’t figure out what I’m missing. My script updates the filename and date on an Illustrator file and exports a secured PDF that will not allow anyone to edit or print the pdf. I can get it secured and but I can not figure out how to disable printing.
Here is my scritp as it stands:
-- System Date
tell (current date) to get (it's month as integer) & "/" & day & "/" & (it's year as integer)
set mgDate to the result as string
tell application "Adobe Illustrator"
-- Filename
tell application "Adobe Illustrator" to set mgName to (name of document 1)
set theFilePath to file path of document 1 as string
set the oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to ":"
set thePathItems to text items of theFilePath
set AppleScript's text item delimiters to the oldDelims
set parsedPath to items 1 thru ((count of items of thePathItems) - 1) of thePathItems
set AppleScript's text item delimiters to ":"
set parentPath to parsedPath as string
set AppleScript's text item delimiters to the oldDelims
set text item delimiters of AppleScript to ""
if mgName contains ".ai" then
set aCount to count every character of mgName
set aCount to aCount - 3
set mgName to characters 1 thru aCount of mgName as string
set mgName to mgName as string
end if
set savePDFPath to parentPath & ":" & mgName & ".pdf"
-- Date
set contents of text frame "date" of document 1 to mgDate
set contents of text frame "filename" of document 1 to mgName
--PDF Save Options
set pdfSaveOptions to {class:PDF save options, compatibility:Acrobat 8, enable access:false, require doc password:true, require perm password:true, preserve editability:false, permission password:"Test", allow printing:pdf 40 print none, changes allowed:pdf 40 no changes, enable copy:false}
save current document in file savePDFPath as pdf with options pdfSaveOptions
end tell
It will create the pdf and it is secured but the printing is still enabled and I can’t figure out how to disable it. Any help would be greatly appreciated.
The security panel in Acrobat showing that printing is still allowed. All I want the end user to be able to do is view the pdf.