Wednesday, August 10, 2016

Submitting a PDF file to an external service

PDF icon by Double-J Design
In addition to saving data to a database, Orbeon Forms can submit (or send) data to external services. If you just want to send the captured data as XML, it is very easy:
  1. Add the built-in "Send" or "Submit" button
  2. Configure the URL of the service
  3. Done!
Sometimes, you want to do more, and you can configure the details through what Orbeon Forms calls simple processes. These define a series of steps to perform in response to the user activating a button, including error recovery. You can, for example, specify that a "Submit" button must:
  1. Check that the data is valid.
  2. Save it to the local database.
  3. Email it to the user's email address.
  4. Send it to a workflow service via HTTP.
Until recently, though, it wasn't easily possible to send the form exported as a binary PDF to an external service. Orbeon Forms has a couple of options for PDF production, and there was a way to send a callback URL for the PDF to a service, but that was difficult to setup.

Orbeon Forms 2016.2 fixes this and includes a way to directly send the PDF to a service. So now you can, for example, write a "Submit" process which sends the XML data and the PDF to one or multiple HTTP services. You do this by passing the new pdf token to the built-in send action. (Similarly, you can now send a binary TIFF document with the new tiff token.)

We hope you will like this simple but hopefully useful new feature!

No comments:

Post a Comment