PDFpenPro logo PDFpenPro logo

Help: Backend Processing of PDF Forms (Advanced Topic)

This feature is an optional addition to collecting form data. It is an advanced feature that does require some technical knowledge to implement. To collect form data see Submitting Forms.

There are two backend scripts to demonstrate how you can parse PDF form submissions and use them to populate a Google Spreadsheet document.

You can download the latest version of the scripts and get the latest info on PDFpenPro's backend support at:

https://smilesoftware.com/PDFpenPro/submit

PDFpenPro supports form data submission from submit buttons which specify HTML, XFDF, and PDF format. If you need FDF submit support, please let us know.

PDFpenPro's submit button object is set to submit in XFDF format.

We strongly recommend you use XFDF, as it has the best character encoding support of any of the available form submission formats.


Backend Scripts

The backend scripts which ship with PDFpenPro 5.0 can handle HTML, XFDF, PDF and FDF submissions.

You should be familiar with CGIs, and some Perl and Ruby won't hurt.

pdfpensubmit.cgi

  • This Perl script is designed to extract the field names and values from any of the possible submission formats. It then pipes the tab separated data to another script to do something useful with the data. It also handles providing a PDF response, presently in the form of static PDF documents -- one for success, a different one for failure.
  • Prerequisites: PDF::FDF::Simple for FDF processing, CAM::PDF for PDF processing.
  • Limitations: The FDF backend does not handle non-Roman characters sets such as GBK. Use XFDF for submitting non-Roman characters.

pdfpensubmit_googledocs.rb

  • This Ruby script takes lines of tab-separated name / value pairs and uses them to populate a Google Spreadsheet. If the form includes a field named com.pdfpen.docID , that will be used to locate the document. If absent, "Unknown ID" is used. If the form includes a field named com.pdfpen.docTitle , that will be used to title the document. If absent, "Form Responses" is used. The first row of the spreadsheet is populated with the names of the fields. Each subsequent row is a single form submission.
  • Prerequisites: gem sources -a http://gemcutter.org; sudo gem install google-spreadsheet- ruby.


© 2003-2017 SmileOnMyMac, LLC dba Smile. All rights reserved.
PDFpen and PDFpenPro are registered trademarks of Smile. The Smile logo is a trademark of Smile.