__construct()
__construct(array $parms)
Constructor.
Parameters
| array | $parms | An array of parameters to override the preferences. |
This class provides a convenient mechanism for generating PDF from HTML content.
This class will read the modules preferences for page size, orientation, and headers and footers. Though the parameters allow overriding them.
This class directly uses mPdf for generating PDF from HTML. The HTML provided must be compatible with that understood by mPdf. Please see the documentation on that website for more information about supported and unsupportd HTML and CSS.
Trivial Example:
$obj = new \CGHTML2PDF\html2pdf();
$obj->writeHTML('<p>This is a test</p>');
$obj->Output();
__construct(array $parms)
Constructor.
| array | $parms | An array of parameters to override the preferences. |
writeHTML(string $html)
Generate the PDF code from the HTML.
This method does not generate a PDF file, however it builds the in-memory structure so that PDF can be generated. This can be a very memory intensive operation depending upon the size of the document provided.
| string | $html | The HTML document. |
Output(string $filename, string $dest)
Generate PDF output.
| string | $filename | The destination filename. |
| string | $dest | The output destination. Possible values are: |