Hi,
I am not quite sure if this is even possible- I need to have a script that will activate security in a PDF (require password for editing/extracting content, OK to print high res) and generate a random password, and resave the file. It of course can't re-ask to have the password entered by hand, as no one will know the random password, it has to all get set programatically.
I need to integrate this in an Applescript that will combine a couple non-secure files into a secure file. I'm fine with the Applescript part but don't have a knowledge of javascript.
Any examples or code/snippets is appreciated!
Chris
As Bernd said, not possible, as I found out also, so I decided to use Security Policies
and have javascript called via do script, careful though as this may fail using 10.5.7 Intel AppleScript 2.0.1, see threads below
http://macscripter.net/viewtopic.php?id=29440
http://macscripter.net/viewtopic.php?id=29650
this script was suggested to me and works great under 10.4.11 Applescript 1.10.7 Acrobat 8.1.3
Just change the "NAME OF YOUR SECURITY POLICY HERE" to the name of your policy.
set Default_Path to (path to desktop as Unicode text)
set PDF_Security to "var policyArray = security.getSecurityPolicies(); for (var i = 0; i < policyArray.length; i++) {if (policyArray[i].name == 'NAME OF YOUR SECURITY POLICY HERE') { var myPolicy = policyArray[i]}} this.encryptUsingPolicy( myPolicy );"
tell application "Adobe Acrobat Professional"
activate
tell active doc
set File_Name to name
do script PDF_Security
if modified is true then
save to file (Default_Path & File_Name) -- Save as required… For Certified Document
close
end if
end tell
end tell
Kev
North America
Europe, Middle East and Africa
Asia Pacific