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

Some info about adobe JavaScript automation:

Community Beginner ,
Mar 14, 2023 Mar 14, 2023

Copy link to clipboard

Copied

Hello,

Good day everybody, I have created a javascript to add certificate file to 500 pdf documents or more etc. Now my questions are:

Is there any way to draw rectangles of the signature field once after running the action wizard? and store coordinates as global to continue for other pdfs? If yes, can you tell in short how?
Also is there an alternative of action wizard, like instead create a custom tool to select the folder and run the javascript? because my team members are finding it difficult to run
Seeking for your feedbacks or any alternative solution 🙏🙏

Thank you

TOPICS
How to , JavaScript , Security digital signatures and esignatures

Views

1.7K

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 2 Correct answers

Community Expert , Mar 16, 2023 Mar 16, 2023

You would have to do it in two separate steps. One would be to manually add a Square comment, for example, then read its coordinates using a script to a global object, then run the Action to add the signature field to your files using that location.

Votes

Translate

Translate
Community Expert , Mar 16, 2023 Mar 16, 2023

The simple technique is as stated by Try67. Create one thing that shows the location before running the Action(batch). The batch script then reads the location coordinates and uses them to create things on all the other documents. An automation script could also be created to assist with the drawing the initial thing and save the coordinates in a global variable, so the batch script uses the global variable instead of the first document needing to contains the thing with the coordinates.  

 

The

...

Votes

Translate

Translate
Community Expert ,
Mar 14, 2023 Mar 14, 2023

Copy link to clipboard

Copied

- Do you mean add a signature field? If so, then yes, using the addField method of the Document object. The API reference for that method lists how to use it.

- No, only the Action Wizard can be used to process multiple files in Acrobat.

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 ,
Mar 16, 2023 Mar 16, 2023

Copy link to clipboard

Copied

Ok, thank you so much

About the signature field I meant, var sigField = this.addField("Signature_sign", "signature", 0, [10, 67, 122, 24]);
so instead of writing [10, 67, 122, 24], is there any method to draw it using mouse? and get the coordinates then use is for the rest of the doucment?

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 ,
Mar 16, 2023 Mar 16, 2023

Copy link to clipboard

Copied

The simple technique is as stated by Try67. Create one thing that shows the location before running the Action(batch). The batch script then reads the location coordinates and uses them to create things on all the other documents. An automation script could also be created to assist with the drawing the initial thing and save the coordinates in a global variable, so the batch script uses the global variable instead of the first document needing to contains the thing with the coordinates.  

 

There is another more complex method that lets the user interactively draw a box at the start of the batch script. It's complex, partly because a batch script doesn't know which document is first, so it doesn't know when it should perform an initialization action, like getting info from the user. 

 

I'd suggest going with the simple technique first. 

 

  

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Mar 15, 2023 Mar 15, 2023

Copy link to clipboard

Copied

I think this will help:

https://www.pdfscripting.com/public/Automating-Acrobat.cfm

 

The Acobat JavaScript model is sandboxed for security, meaning that there is limited file system access.  A script can open a specific PDF file from the file system, but it can't get a directory listing of files. So the Action (batch process) is the only way for a script to process to an entire folder of files.

 

An alternative is to create a desktop .Net or applescript application that collects the files and executes an Acrobat Script through the IAC interface. 

 

To answer your question about rectangles and signatures, the answer is likely to be yes, but can't say without more information. Please explain exactly how you are doing this now. Post the relevant parts of your script. 

 

 Here's the reference entry for the global object:

https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/JS_API_AcroJS.html#creating-global...

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Mar 16, 2023 Mar 16, 2023

Copy link to clipboard

Copied

Ok thank you so much for giving a solutiom,

About the signature field I meant, var sigField = this.addField("Signature_sign", "signature", 0, [10, 67, 122, 24]);
so instead of writing [10, 67, 122, 24], is there any method to draw it using mouse? and get the coordinates then use is for the rest of the doucment?

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 ,
Mar 16, 2023 Mar 16, 2023

Copy link to clipboard

Copied

Create a signature field and read the coordinates of this 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 ,
Mar 16, 2023 Mar 16, 2023

Copy link to clipboard

Copied

You would have to do it in two separate steps. One would be to manually add a Square comment, for example, then read its coordinates using a script to a global object, then run the Action to add the signature field to your files using that 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 ,
Mar 18, 2023 Mar 18, 2023

Copy link to clipboard

Copied

Ok thank you so much everybody for the help, I really appreciate 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
New Here ,
Mar 18, 2023 Mar 18, 2023

Copy link to clipboard

Copied

LATEST
Преузмите Outlook за Android<>

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