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

JavaScript invalidates the certified document

Community Beginner ,
Sep 30, 2018 Sep 30, 2018

Copy link to clipboard

Copied

I would like to display all the attachments in the document in a list which are attached by addAnnot. For that purpose I created a list which will run below script on mouseUp event.. But whenever the script runs, it basically invalidates the certified document with an invisible signature. I need to prevent any unauthorized modification in the document, for that purpose I created certified document. Any Idea how to make it right or please suggest me if I am doing something wrong as I am new to acrobat development.

attachList = [];

var annots = this.getAnnots();

var aAttach = annots.filter(function(a){return (a.type=="FileAttachment");});

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

attachList.push(aAttach[i].attachment.name);

event.target.setItems(attachList);

TOPICS
Acrobat SDK and JavaScript , Windows

Views

259

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
community guidelines
LEGEND ,
Sep 30, 2018 Sep 30, 2018

Copy link to clipboard

Copied

You need to do this differently. You are preventing all modifications, there aren’t “authorised” modifications. You can’t be Modifying a verified document for any reason, and setitems will do that. Perhaps you can do this immediately before certifying, knowing the list won’t change.

Votes

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
community guidelines
LEGEND ,
Oct 01, 2018 Oct 01, 2018

Copy link to clipboard

Copied

https://forums.adobe.com/people/Test+Screen+Name  wrote

You need to do this differently. You are preventing all modifications, there aren’t “authorised” modifications. You can’t be Modifying a verified document for any reason, and setitems will do that. Perhaps you can do this immediately before certifying, knowing the list won’t change.

When you add a certification signature, you can specify certain modifications that are allowed without invalidating the signature. Changes like filling form fields, adding annotations, and signing digital signature fields.

Votes

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
community guidelines
Community Beginner ,
Oct 01, 2018 Oct 01, 2018

Copy link to clipboard

Copied

That's right. I just want to display the attached documents in a list using 'setitem' dynamically whenever new attachments got added. At the same time prevent any modification in the form fields. Since I cannot proceed with both, I think adding an invisible signature before rolling it out to prevent any modifications. I think that will do the job. Correct?

Votes

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
community guidelines
LEGEND ,
Oct 01, 2018 Oct 01, 2018

Copy link to clipboard

Copied

LATEST

You can use a certification signature to prevent any further changes, yes, if that's what you want. I thought you want to allow certain changes after you sent it out though (i.e., adding file attachment comments), which is why I suggested what I did.

Votes

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
community guidelines
LEGEND ,
Oct 01, 2018 Oct 01, 2018

Copy link to clipboard

Copied

If you just need to display the list of attachments, you could use either a multiline text field (changing a field's value should be OK), or an app.alert dialog, or even writing to the JavaScript console and displaying it.

Votes

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
community guidelines