Highlighted

Retrieving PDF Security Preferences

Explorer ,
May 19, 2020

Copy link to clipboard

Copied

Hi all,

 

Does anyone know of a way to retrieve the PDF security settings from app.pdfExportPreferences after export? I've tried accessing properties like disallowChanging, disallowPrinting, etc., but they don't seem to stick like the other PDF preferences. Here's what I have:

// User sets PDF preferences
app.activeDocument.exportFile(ExportFormat.pdfType, File('~/Desktop/example.pdf'), true);

if (app.pdfExportPreferences.useSecurity == true) {
  alert(app.pdfExportPreferences.disallowChanging);
  // Doesn't correspond with settings set in export window
}

Any help is greatly appreciated. Thanks so much!

TOPICS
Scripting, SDK

Views

334

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Retrieving PDF Security Preferences

Explorer ,
May 19, 2020

Copy link to clipboard

Copied

Hi all,

 

Does anyone know of a way to retrieve the PDF security settings from app.pdfExportPreferences after export? I've tried accessing properties like disallowChanging, disallowPrinting, etc., but they don't seem to stick like the other PDF preferences. Here's what I have:

// User sets PDF preferences
app.activeDocument.exportFile(ExportFormat.pdfType, File('~/Desktop/example.pdf'), true);

if (app.pdfExportPreferences.useSecurity == true) {
  alert(app.pdfExportPreferences.disallowChanging);
  // Doesn't correspond with settings set in export window
}

Any help is greatly appreciated. Thanks so much!

TOPICS
Scripting, SDK

Views

335

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 19, 2020 0
Adobe Community Professional ,
May 19, 2020

Copy link to clipboard

Copied

You seem to be right, these properties are being reset once the export is done. Could you elaborate what are you trying to achieve, i am not sure i am quite understanding the utility of the workflow

 

-Manan

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 19, 2020 0
Explorer ,
May 19, 2020

Copy link to clipboard

Copied

I'm trying to prevent export and return an error message (via a "beforeExport" event listener) if any PDF passwords or restrictions are set. My script works in conjunction with Acrobat and it's not able to run properly if the exported PDF is password-protected.

 

Hopefully that makes sense. Thinking I might need to address the problem in Acrobat rather than InDesign.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 19, 2020 0