: This article mainly introduces the best MPDF class for php to generate PDF files. if you are interested in PHP tutorials, please refer to it. Mpdf official: http://www.mpdf1.com/mpdf/download
Download there are instances, you can refer to do a know. of course, the official website also has an instance, Web site: http://mpdf1.com/common/mpdf/examples/
Official documentation: http://mpdf1.com/manual/
UseAdobeCJK = true; $ mpdf-> SetAutoFont (AUTOFONT_ALL); // The static file to be generated: html#file_get_contents('template.html '); echo $ html; exit; // set the content of the PDF header $ header ='
'; // Set the content of the PDF footer $ footer ='
|
Footer |
Page Number: {PAGENO}/{nb} |
'; // Add the header and footer to the pdf file $ mpdf-> SetHTMLHeader ($ header); $ mpdf-> SetHTMLFooter ($ footer ); // Set the pdf display mode $ mpdf-> SetDisplayMode ('fullpage'); // Set the pdf size to 270mm * 397mm // $ mpdf-> WriteHTML ('
'); // Create a pdf file $ mpdf-> WriteHTML ($ html); // delete the first page of the pdf file (one more page due to setting the pdf size) // $ mpdf-> DeletePages (); // Output pdf $ mpdf-> Output (); exit;?>
The above introduces the best MPDF class for php to generate PDF, including some content, and hope to be helpful to friends who are interested in PHP tutorials.