Copy link to clipboard
Copied
Is it possible to add an FDF file inside a PDF automatically using python or javascript?
The FDF file is the file with the comments of a PDF. It is NOT for filling in a fillable PDF.
Copy link to clipboard
Copied
You can import an FDF file using JavaScript, yes. See the documentation of the importAnFDF method of the Document object.
The question remains what you mean by "automatically", though. Something has to trigger this action.
Copy link to clipboard
Copied
using the importAnFDF method is it possible to import an FDF like the attached one?
What I find is how to import FDF to fill in autofillable PDFs.
I uploaded it as .txt because it wouldn't let you upload .fdf, but it really is a .fdf, you just have to change the extension.
Copy link to clipboard
Copied
It didn't upload, but if you mean one that creates comments, then yes.
Copy link to clipboard
Copied
Exactly, a comment file (text box, text box with callout...)
Could you give me a link where I can see how to do this?
Can it be done with any python library?
Copy link to clipboard
Copied
You can find the documentation of this method in the Acrobat JS API Reference, which is a part of the Acrobat SDK, but the basic command is very simple, since it only takes one input parameter:
this.importAnFDF("/C/My Files/Data.fdf");
You can also specify a relative path, if the FDF is in the same folder as the PDF file, for example:
this.importAnFDF("Data.fdf");
I don't know about Python.
Copy link to clipboard
Copied
The best way to generate an FDF containing Annotations is to use the "doc.exportAsFDF()" function to export an FDF containing annotations. Open the FDF in a text editor to see how it all works. You'll find the FDF specification as a sub-section in the PDF specification.
An FDF can also be loaded from the command line or as a query parameter in an URL.
https://community.adobe.com/t5/acrobat-reader-discussions/opening-pdf-with-parameters/td-p/10146246
It can also be loaded as the response from a submitForm action.