Dompdf library
- Moodle 1.9–5.1
- 更新 2024-07-18
Dompdf is an HTML to PDF converter. It is intended to be used as a library by other plugins.
Dompdf is an HTML to PDF converter
At its heart, dompdf is (mostly) a CSS 2.1 compliant
HTML layout and rendering engine written in PHP. It is a style-driven renderer:
it will download and read external stylesheets, inline style tags, and the style
attributes of individual HTML elements. It also supports most presentational
HTML attributes.
Requirements
Moodle 2.9+
MBString extension
Recommendations
OPcache (OPcache, XCache, APC, etc.): improves performance
IMagick or GMagick extension: improves image processing performance
Visit the wiki for more information:
https://github.com/dompdf/dompdf/wiki/Requirements
Internal settings
By default whenever a PDF is generated systems uses $CFG->localcachedir/dompdf to store temporary data.
Usage
To create new instance of the PDF class use following code:
$pdf = local_dompdfapipdf::createnew();
- 1.4Moodle 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 4.0, 4.1, 4.2, 4.3, 4.4
- 1.0Moodle 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6