Skip to main content
Participant
July 15, 2016
Answered

Importing Annotations with JavaScript?

  • July 15, 2016
  • 1 reply
  • 997 views

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

This topic has been closed for replies.
Correct answer mikew5446

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?

1 reply

Inspiring
July 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.

mikew5446AuthorCorrect answer
Participant
July 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?