title: Creating a dynamic PDF (with Form-Fields and interactive Elements) from PHP
body: <p>first let me say I searched a while before creating this request. Just to be sure :).</p>
  
  <p>I would like to create a dynamic PDF via PHP. There are many free classes (DomPDF, TCPDF, Zend_PDF and others) that can handle the regular (static) PDF creation without problems.</p>
  
  <p>However, what my need is:</p>
  
  <ol>
  <li>A Backend where you can create/read/update/delete some sets of data (Which is not the problem).</li>
  <li>If any data in the backend was changed, a PDF gets written. This pdf has a static header and footer. In the middle part however, there is a dynamic form with all data fields from the backend (so if I create a Field named "Field 1", there should be a text-field on the created pdf also).</li>
  <li>Some parts of the fields need to trigger events, i.e. if I change "Select Box 1" to "Option 2", it should change a headline to a predefined text.</li>
  <li>The form fields need validation, so they must be filled out before printing the pdf (see 5.)</li>
  <li>There should be 2 Buttons, Reset (to reset the form to the defaults) and Print (Which should print the pdf in its current filled out state).</li>
  </ol>
  
  <p>I know this is possible to do via Acrobat directly, but as I need to integrate it into a php based application I must create this form and its data via php.</p>
  
  <p>I have searched on google for this, but did not find any proof that this will work in any of the popular PHP PDF-generators (I searched for Zend_PDF, DomPDF, TCPDF - which has at least support for forms but does not state if there are any possibilities for validation and XPDF).</p>
  
  <p>I could also live with a command line interface if that would be the way to go (like generating a HTML-Page with JS for the validation from my PHP and rendering it to PDF via Tool x).</p>
  
  <p>Is there anyone who has done something similar?</p>