15

Does anyone know how I can save a page as pdf in php?

Example: I have a page that is able to catch the users signature. Now I would like to create a button on the page that will convert the page into pdf so that the file can be saved to a folder.

Below you can see what the signature page looks like: enter image description here

Wouter
  • 1,829
  • 3
  • 28
  • 34
Jin Yong
  • 42,698
  • 72
  • 141
  • 187
  • I guess you want to capture the screen or convert html to pdf. isn't it? – KV Prajapati Sep 21 '11 at 06:46
  • @AVD:I would like to convert the html into pdf, but somehow I want the signature could saved in the pdf like the one showing above (the signature is not in the picture format, it's generated by the javascript) – Jin Yong Sep 21 '11 at 06:54
  • possible duplicate of [Convert HTML + CSS to PDF with PHP?](http://stackoverflow.com/questions/391005/convert-html-css-to-pdf-with-php) – Wouter Mar 06 '15 at 11:18

2 Answers2

11

There are a number of PHP PDF API and tools which convert or wrap up html content including drawings, links and images etc.

A very good thread from StackOverflow :

  1. Convert HTML to PDF using PHP
Shahbaz A.
  • 4,047
  • 4
  • 34
  • 55
KV Prajapati
  • 93,659
  • 19
  • 148
  • 186
5

TCPDF can output PDF's from html: http://www.tcpdf.org/

If you need to use more advanced html you can use WKHTMLTOPDF: http://wkhtmltopdf.org/

Ali Gangji
  • 1,463
  • 13
  • 22
  • I know this is old, but I have been using TCPDF for several years for some large clients and it has not failed me yet. Simple and fast! – Cesar Bielich Jan 17 '13 at 06:25