Submit a completed form as a PDF
For most scenarios, it is recommended to submit via the FormVuAPI. However, in the event you have disabled this API, or the PDF Form itself uses an action targeting this API, FormVu’s submitForm implementation is used.
It can also be accessed via JavaScript using idrform.submitForm(url)
.
This implementation does the following:
- Saves the current filled out form as a PDF
- Encodes the PDF into a Base64 encoded string
- Submits the Base64 encoded string as a POST submission using a “pdfdata” key
For example, a raw submission would look similar to this:
pdfdata=VGhpcyBpcyBhbiBleGFtcGxlIEJhc2U2NCBzdHJpbmcsIG5vdCBhbiBleGFtcGxlIFBERiB0aGF0IHlvdSB3b3VsZCBleHBlY3QgdG8gc2Vl
To handle these submissions, the receiving endpoint would be expected to:
- Receive the POST submission
- Access the “pdfdata” key
- Decode the Base64 stream
- Save the output as a PDF file
Consider using the submitUrl setting, to preset the submission URL endpoint