Convert a web page into PDF format, download and save into folder as below. Include dompdf_config.inc.php file from the library. Create a folder for saving the PDF file which is generated from the webpage. HTML code to convert on submit: Download dompdf library from the github which is free. Click here to download.