Skip to main content
Participating Frequently
March 20, 2024
Answered

How does this.submitForm work?

  • March 20, 2024
  • 2 replies
  • 1812 views

I am submitting to an endpoint and it returns a simple FDF file

                %FDF-1.2
                1 0 obj
                <<
                    /FDF
                    <<
                        /Fields
                        [
                            << /T(Status) /V(OK) >>
                        ]
                    >>
                >>
                endobj
                trailer
                << /Root 1 0 R >>
                %%EOF

How are the fields going to be read? Are the values of the fields going to be populated in some way in the currently opened PDF file?

This topic has been closed for replies.
Correct answer Thom Parker

As Bernd states, there is not field named "Status" on the form. There is one named "field_1". But that's not referenced in the FDF file.  So the FDF file will do nothing. 

 

An easy test for any FDF file is to save it to a local file and then load it manually using the "Import" menu item in "Prepare Form".  An easy way to verify the format of the FDF is to export data form the form to an FDF usingthe "Export" menu item. Then you can compare the FDF file your loading with one generated by Acrobat, from the specific PDF.

 

  

2 replies

Thom Parker
Community Expert
Community Expert
March 20, 2024

The returned FDF file is applied to the PDF that performed the submit action. 

But if for example, the current PDF did not contain a text field named "Status", then nothing would happen. 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participating Frequently
March 21, 2024

Thanks for your answer, however I'm having some difficulties getting the response to be shown on the PDF.

I have attached a PDF with a text field named "Status". I call `this.submitForm` within this PDF and the server responds with the FDF file I sent above. But after the submission, I don't see any value in the field. Any ideas?

Bernd Alheit
Community Expert
Community Expert
March 21, 2024

The PDF file has no field with the name "Status".

Bernd Alheit
Community Expert
Community Expert
March 20, 2024

The PDF Reference explains the FDF format.

https://pdfa.org/resource/pdf-specification-archive/