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

Importing Annotations with JavaScript?

New Here ,
Jul 15, 2016 Jul 15, 2016

Can anyone help me with batch importing annotations from an fdf to a pdf.

My workflow is as follows:

- I have multiple folders containing a single pdf file with annotations.

- I use the following code in an Action to extract the annotations:

/* Export FDF */

this.exportAsFDF({cPath:this.path.replace(/\.pdf$/i,".fdf"),bAnnotations:true});

- The result of the above is that I have the following files in each folder:

Document.pdf

Document.fdf

- I then replace the old pdf with a new version. This file is named exactly the same as the old one.

- The final step would be to import the the fdf annotations to the new pdf file.

I am aware of importAnFDF but whenever I try to use it I get asked to browse to the fdf file.

My guess is that I need to get the file path for the import to take the current pdf document path and replace .pdf extension with .fdf.

Is this possible at all and if so any pointers would be really appreciated?

Thanks

Mike

TOPICS
Acrobat SDK and JavaScript
926
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

correct answers 1 Correct answer

New Here , Jul 19, 2016 Jul 19, 2016

OK - so I didn't really understand my code before but I do now thanks to your steer.

For anyone else looking to do something similar:

/* Import FDF */

importAnFDF({cPath:this.path.replace(/\.pdf$/i,".fdf")})

I'm not sure who earns the Correct Answer on this one though gkaiseril?

Translate
LEGEND ,
Jul 15, 2016 Jul 15, 2016

You are being prompted to search for the file because you did not provide the PDF file to open parameter. Since you computed the export name from the document name for the export, you need to do the same for the import script.

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 ,
Jul 19, 2016 Jul 19, 2016
LATEST

OK - so I didn't really understand my code before but I do now thanks to your steer.

For anyone else looking to do something similar:

/* Import FDF */

importAnFDF({cPath:this.path.replace(/\.pdf$/i,".fdf")})

I'm not sure who earns the Correct Answer on this one though gkaiseril?

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