title: How do I fill a PDF with content from an HTML document via JSP
body: <p>I have the following problem: </p>
  
  <p>I need to write the content of an HTML form into a PDF file when the submit-button is pressed, using JSP.
  Now let's say my HTML looks like this:</p>
  
  <pre><code>&lt;html&gt;
      &lt;body&gt;
          &lt;form action="PDFTest.jsp" method="POST" role="form" name="TestForm"&gt;
  
              Name &lt;input name="inp_name" /&gt;
              First name &lt;input name="inp_firstname" /&gt;
              Street &lt;input name="inp_street" /&gt;
              Zip-code &lt;input name="inp_zip" /&gt;
  
              &lt;button type="submit"&gt;Submit&lt;/button&gt;
  
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The PDF file has also declared fields with the identifiers "inp_name, inp_firstname, inp_street, inp_zip" (I created a form in LibreOffice, added Textfields, named them with the identifiers and exported the form to PDF).</p>
  
  <p>Is it possible to take the input elements by their Name-Tags and copy the content of these elements into the fields of the PDF file? And if it is, how do I do it?
  I heard, that something like this could be done with iText, but I never used it before.</p>
  
  <p>Additionally, is it possible to create a copy of the original PDF file in the JSP so that the copy will be filled with the content and the original only serves as a template?</p>
  
  <p>Thanks in advance for your answers/criticism.</p>