Convert HTML to PDF
An Easy to Use Course
Creating your first mPDF PDFThe instructions for creating this PDF from a basic HTML page are the same for all of the other examples in the PDF Basement.
All you need:
- Text editor to write the code
- Make sure that the mPDF installation is live on your web server
The main thing to check is that the mpdf.php file is correctly referenced. Check your path from your own PHP files to your mPDF directory.View the code of the sample web page View the PDF Yes it’s that simple to generate your own PDF documents. Just let your imagingation run wild.
<?php //============================================================== $html = ' <body> <h1>About Tidalfire</h1> <p>Tidalfire provides PDF business tools and services for desktop, web and mobile.</p> <h2>PDF Forms</h2> <p>Let your business benefit from dynamic PDF forms. Mobile or desktop – convert your paper forms to intelligent, customer friendly documents.</p> <h2>PDF Studio</h2> <p>PDF Studio™ an all-in-one, easy to use PDF editor that provides all the features needed at a fraction of the cost of Adobe® Acrobat® and other editors.</p> <h2>PDF Automation Server</h2> <p>PDF Automation Server (PAS) automates the receiving, processing and routing of documents helping to streamline your document workflows.</p> <h3>Contact Details</h3> <p>e: firstname.lastname@example.org</p> '; //============================================================== require_once __DIR__ . '../../../../../mpdf7/vendor/autoload.php'; $mpdf = new \Mpdf\Mpdf(); $mpdf->WriteHTML($html); $mpdf->Output(); exit; //============================================================== ?>
All code on this site can be used without warranty.
Copyright © 2019 osuch.com