treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Generate PDF file from PHP Form

  • I Need a suggestion to develop a pdf from the data entered in a php form, the pdf should be generated automatically after the user has submitted the form
  • I recommend you look into fpdf.
  • I work at Expected Behavior, and we've developed a product called DocRaptor that converts HTML to PDF using HTTP POST requests.

    You can make a request against our server using PHP, and DocRaptor will generate your document.

    Here's a link to our coding examples for how to make this call using PHP:

    DocRaptor PHP example
  • Fpdf is the best bet, but has some limits for design. Dompdf can convert html pages to pdfs, but is limited also
  • i have used fpdf and it works great according to requirement
  • Nicely done! I also use fpdf and I have found it to be very well documented. I most recently used it to adapt Chris' own Editable Invoice application to output a pdf of invoices I created (as well as using MySQL to keep a permanent log).

    I'm glad it worked out for you.