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

Acrobat Pro Javascript to Import Data File from Comments section

New Here ,
Sep 04, 2024 Sep 04, 2024

Copy link to clipboard

Copied

Hi All, 
Am looking for a JavaScript script to import comments from a different PDF document using the "Import Data File" option in Adobe Acrobat Pro. The script I have works to open the dialog box, but it does not allow for the selection of PDF files or import comments from a different file. This isn't the whole process. Prior to this, there is a resizing of the documents is step 1, which I have worked on and it is working fine.

Kindly help me out to open the dialog box from comments section "Import Data File..."

var cPathToFile = "/path/to/your/comments.fdf";
// Replace with the actual path to your FDF/XFDF file

this.importAnFDF(cPathToFile);

 

TOPICS
Mac

Views

209

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 17, 2024 Sep 17, 2024

Copy link to clipboard

Copied

First, you don't need a script for any of this.

Next, you'll notice that when you select the "Import Data File" option from the drop down menu in the Comment Toosl, it displays a FileOpen dialog for selecting a file. And the file type that it wants is "fdf". this is the only type of file that can contain comments.

 

So, you have to save the comments from the other file into an FDF. This is done from the same menu with the "Export All to Data File..." option. 

 

 

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
New Here ,
Sep 17, 2024 Sep 17, 2024

Copy link to clipboard

Copied

Thank you for your response. I want to create using the guided action in Acrobat to streamline our workflow. Specifically, I need to automate the following steps:

  1. Resizing the document: Adjusting the existing document by adding equal spacing on both sides to accommodate comments.
  2. Importing data from another document: Ensuring the imported document is of the same size so that annotations align perfectly.
  3. Adding a red box with text: Inserting a red text box in Arial to allow for additional annotations when necessary. This feature is typically required in most cases, although not always.

    And somehow to could achieve step 1 and Step 3 only step 2 is not happening.

Automating these steps would significantly enhance our productivity, as we handle a large volume of documents regularly in the pharmaceutical industry. Your guidance on how to proceed would be greatly appreciated.

Looking forward to your support.

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 17, 2024 Sep 17, 2024

Copy link to clipboard

Copied

LATEST

There are a couple of ways to transfer comments from one PDF to another using an automation script. 

In both cases, both the source PDF and the destination PDF have to be open in Acrobat. 

 

Method #1:  Export comments from the source to an fdf file. Then import the fdf into the target PDF. 

                      Use the doc.exportAsFDF and doc.importAnFDF functions 

 

Method #2:  Loop through all the annotations on the source PDF. Acquire a "properties" object from each annotation and use it to re-create the annotation on the target PDF. 

 

 

 

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