TCPDF - Create PDF from Form Values and Link to PDF Download
I am working on a payment module and I wish to create an option to allow the user download a PDF version of their Receipt.
At the moment, I am capturing the form values and displaying a receipt of their payment on the page in HTML, like:
<p>Receipt for Purchase:</p>
<li>First Name: $pfirstname </li>
<li>Last Name: $plastname</li>
<li>Address 1: $paddress1</li>
<li>Address 2: $paddress2</li>
How do I create a link at the bottom of this to allow them download or open a PDF version of this with the form values?
Attached is the PHP file which uses TCPDF to create a blank PDF document on the server, but without the form values.