How to save a page as pdf in php

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

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

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

Solution 2

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/

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply