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

Script for Batch sign multiple pdf documents at once ?

Community Beginner ,
Oct 10, 2022 Oct 10, 2022

Copy link to clipboard

Copied

I have 1000 similar documents that all need to be signed in the same location on the document on page 1. Is it possible to do so by scripting in Adobe without having to individually open sign and save the document?

Adobe Acrobat Pro. Same location on the same page in all files and digital signature. 

TOPICS
JavaScript

Views

14.2K

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

correct answers 1 Correct answer

Community Expert , Oct 13, 2022 Oct 13, 2022

Then you can use an Action (Tools - Action Wizard) with the following code:

 

var sigField = this.addField("Signature1", "signature", 0, [10, 67, 122, 24]);
var mySignatureProfileFilePath = "/C/Users/YOUR_USER_NAME/AppData/Roaming/Adobe/Acrobat/DC/Security/TEST.pfx"; // ADJUST TO ACTUAL FILE PATH ON YOUR COMPUTER
var myPassword = "ABCD1234"; // ADJUST TO ACTUAL PASSWORD FOR THE PROFILE SELECTED ABOVE
var myEngine = security.getHandler( "Adobe.PPKLite");
if (myEngine.login(myPassword, mySignature
...

Votes

Translate

Translate
Community Expert ,
Oct 10, 2022 Oct 10, 2022

Copy link to clipboard

Copied

Do the files already contain a digital signature field? If so, does it have the same name in all files?

 

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 10, 2022 Oct 10, 2022

Copy link to clipboard

Copied

no digital signature field.

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 Expert ,
Oct 11, 2022 Oct 11, 2022

Copy link to clipboard

Copied

So the Action should add a digital signature field and then sign it? Should it always appear on the same page and in the same location?

 

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 11, 2022 Oct 11, 2022

Copy link to clipboard

Copied

Yes, exactly and on the first page and same location in all the pdf files. 

Thank you so much for helping out!

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
New Here ,
Oct 11, 2022 Oct 11, 2022

Copy link to clipboard

Copied

Khanh nguyen

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 Expert ,
Oct 11, 2022 Oct 11, 2022

Copy link to clipboard

Copied

What's the exact version number of the application (You can find it out by going to Help - About Adobe Acrobat)? What's your OS version?

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 12, 2022 Oct 12, 2022

Copy link to clipboard

Copied

TANMAY265185123txa_0-1665642657139.png

Adobe Acrobat Pro DC

Coutinous release version 2022.002.20191 64 bit

 

OS Version 

Edition Windows 10 Business
Version 21H2
OS build 19044.1586
Experience Windows Feature Experience Pack 120.2212.4170.0

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 Expert ,
Oct 13, 2022 Oct 13, 2022

Copy link to clipboard

Copied

Then you can use an Action (Tools - Action Wizard) with the following code:

 

var sigField = this.addField("Signature1", "signature", 0, [10, 67, 122, 24]);
var mySignatureProfileFilePath = "/C/Users/YOUR_USER_NAME/AppData/Roaming/Adobe/Acrobat/DC/Security/TEST.pfx"; // ADJUST TO ACTUAL FILE PATH ON YOUR COMPUTER
var myPassword = "ABCD1234"; // ADJUST TO ACTUAL PASSWORD FOR THE PROFILE SELECTED ABOVE
var myEngine = security.getHandler( "Adobe.PPKLite");
if (myEngine.login(myPassword, mySignatureProfileFilePath))
	sigField.signatureSign( myEngine, { password: myPassword});
else app.alert("Error! Could not login to the Security Handler.");

 

This will add a Signature field to the bottom-left corner of the first page and then sign it using the specified signature profile. However, you might be prompted to save the file manually after doing so... If it's not, add a Save command to your Action, after the command that executes this JS code.

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 14, 2022 Oct 14, 2022

Copy link to clipboard

Copied

hi,

thanks for the code I was able to get the PDF sign but there is an issue after signing the document, if I right-click on the signature field there is an option to clear the signature. sharing the screenshot for your reference.  

TANMAY265185123txa_0-1665754708038.png

so can you help me out how to lock the digital signature .

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 Expert ,
Oct 14, 2022 Oct 14, 2022

Copy link to clipboard

Copied

Only you can do that... If you open it on another computer it will not appear.

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
New Here ,
Sep 01, 2023 Sep 01, 2023

Copy link to clipboard

Copied

Hi, Is it possible to place pfx file/digitally sign the complete set of documents instead of individually signing in each sign field. Also, please share how to add the save command to the action.

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 Expert ,
Sep 01, 2023 Sep 01, 2023

Copy link to clipboard

Copied

LATEST

No, it has to be done one file (and one field) at a time.

And there's a built-in Save command in the Action Wizard you can add, under Save & Export:

 

try67_0-1693568006542.png

 

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
New Here ,
Oct 19, 2022 Oct 19, 2022

Copy link to clipboard

Copied

@try67, I tried using this code, but the signature field was not filled. Maybe I am doing something wrong?

 

The folder of my certificate is write like this:

"/Z/OneDrive/1. Colibri/0. Contabilidade e Finanças/99. Certificado Digital/2022/Certificate.pfx"

 

Should I, instead of that, use _ istead of spaces, like this?

 

"/Z/OneDrive/1._Colibri/0._Contabilidade_e_Finanças/99._Certificado Digital/2022/Certificate.pfx";

 

 

I would like to do something similar you indicated, but with a small change:

 

- I want an invisible signature, not a visible one

- I would like block the document after sign

 

Could you help me with that?

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
New Here ,
Oct 19, 2022 Oct 19, 2022

Copy link to clipboard

Copied

Just to let you know...

I tried also using the _ instead of space, but I still can't load automatically the signature to the filed that was created.

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
New Here ,
Apr 14, 2023 Apr 14, 2023

Copy link to clipboard

Copied

@try67 - I am getting the same empty signature field as @sergiolucianojr . I then have to click the signature fill and apply the information manually.

Is the line below supposed to have my specific signature names used instead? 

var sigField = this.addField("Signature1", "signature", 0, [10, 67, 122, 24]);

 

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 Expert ,
Apr 14, 2023 Apr 14, 2023

Copy link to clipboard

Copied

Yes, that only adds a blank Signature field. To sign it you must use the signatureSign method of the Field object, with all the required parameters.

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
New Here ,
May 11, 2023 May 11, 2023

Copy link to clipboard

Copied

Hello, i have a similar problem. I want to sign a batch of 12 contrats, each one with 4 pages, and signature (digital certificate) should be on the last page. I want a find the way of only having to enter the signature PIN 1 time (i´m using a card reader). My Adobe version is 

Architecture: arm64

Processor: Apple M1

Build: 23.1.20177.0

AGM: 7.0.4

CoolType: 8.2.1

JP2K: 4.0.0.52671

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
New Here ,
May 15, 2023 May 15, 2023

Copy link to clipboard

Copied

No help?

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