Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Javascript Password Protection

New Here ,
May 24, 2016 May 24, 2016

I have a script that will extract pages from a document, apply an existing security policy (to password protect the document from changes) and save them. This all works well, however Adobe still keeps coming up with the Password Security - Settings dialog window for each file. Can someone recommend a way to automatically do this without the window opening, either in the Javascript or in the policy.

I am using Pro XI,

Thanks in advance.

Jeff

TOPICS
Acrobat SDK and JavaScript , Windows
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 24, 2016 May 24, 2016

Can you post the relevant code that you're currently using?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 24, 2016 May 24, 2016

The relevant piece of code just applies the policy from my Adobe policies - this is working fine, however the policy will invoke the Adobe dialog:

var rtn = Currpage.encryptUsingPolicy({oPolicy: oMyPolicy })
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 24, 2016 May 24, 2016

How did you define the oPolicy parameter?

On Tue, May 24, 2016 at 5:52 PM, jeffreyb93219864 <forums_noreply@adobe.com>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 24, 2016 May 24, 2016
LATEST

The policy was created in Adobe (Tools->Protection->Encrypt->Manage security policies->New

The code then cycles through the polices until it matches the name "MyCerts":

var sPolicyName = "MyCerts";

app.beginPriv();

var AllPolicies = security.getSecurityPolicies();

for(var i=0; i<AllPolicies.length; i++)

{

     if(AllPolicies.name == sPolicyName)

     {

          oMyPolicy = AllPolicies;

          break;

     }

}

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