Skip to main content
bryant51645657
Participant
December 8, 2017
Question

Script to save pdf with password

  • December 8, 2017
  • 2 replies
  • 1555 views

Hello,

I would really appreciate a script that can save the current file as pdf with password.

What I do normally is this:

1- Save as.

2- PDF Format.

3- Save in the same location as the original file.

4- Adobe PDF Preset: Smallest File Size

5- Go to "Security" then "Use a password to restrict..."

6- Set Password

    Done.

I found this script in another thread on this forum:

var pdfFile = new File(app.activeDocument.fullName.toString().replace(".ai",".pdf")); 

var saveOpts = new PDFSaveOptions(); //You can set PDF SaveOptions like below properties...   

saveOpts.PDFXStandard = 2; //X1a 2001 

app.activeDocument.saveAs (pdfFile, saveOpts); 

Could this be modified to my needs?

Thanks!

This topic has been closed for replies.

2 replies

itsBenMason
Inspiring
December 11, 2017

saveOpts.documentPassword = "password";

saveOpts.requireDocumentPassword = true;

renél80416020
Inspiring
December 10, 2017

for which software ?

(Illustrator)