Generating PDFs from a form using submitted data


Hi all,

I’m in the process of building an app where I’ll want to collect and generate W-9’s. I’ve no intention of saving the submitted info in a collection. Rather, I want to generate a PDF version of the W-9 and upload it to S3 or similar and then just notate that the W-9 has been completed. In looking into how best to do this, I came across the following StackOverflow that seems to address most of the same issues: I reached out to Aaron and he suggested I post my questions here.

So, I was looking for further guidance on exactly how best to achieve what I’m after.

For example, how best to generate the XFDF files? I assume it’s best to just dump the XFDF in /tmp or something? Once I have the XFDF how best to handle the merge with pdftk-server? As I understand it it’s just a command line utility that needs to be on the server, yes? So, should I do something like this: or what? Also any advice or thoughts on the subsequent storage to S3 (or other) would be appreciated.

Thanks in advance for any help.



A good place to start is the package aadams:pdftk to formfill and concatenations. Also, use XmlBuilder to generate your XFDF files.