Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
The PDF Reference explains the FDF format.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
The PDF file has no field with the name "Status".
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Thank you, I figured it out and managed to populate the field with the returned FDF.