API reference / Quittio \ Core \ Pdf \ Renderers
MpdfRenderer
final class in quittio/core · implements PdfRenderer
Quittio\Core\Pdf\Renderers\MpdfRenderer · Source
Default renderer: HTML/CSS to PDF/A-3b with mPDF, in pure PHP.
PDF/A, the embedded XML and the XMP metadata are written in one pass.
Methods#
| Method | Description |
|---|---|
->__construct() | |
->render() | Renders the HTML with mPDF and returns the PDF; with $request->pdfa as PDF/A-3b, with the embedded XML and its Factur-X XMP metadata in the same pass. A line table across pages gets carry-over rows at each page break. Throws a PdfException when mPDF fails. |
->supportsEmbedding() |
__construct()#
public function __construct(
?string $tempDir = null,
array<string, array<string, string>> $fonts = [],
list<string> $fontDirectories = [],
string $defaultFont = 'geist',
bool $pdfaAuto = false,
bool $simpleTables = false,
)| Parameter | Type | Description |
|---|---|---|
$tempDir | ?string = null | |
$fonts | array<string, array<string, string>> = [] | additional fonts: family => [R => file, B => file, I => file, BI => file] |
$fontDirectories | list<string> = [] | searched first, before the bundled Geist, Inter and Liberation Sans and the fonts of mPDF, so that files with the same name (e.g. a published and edited Inter) replace them |
$defaultFont | string = 'geist' | |
$pdfaAuto | bool = false | |
$simpleTables | bool = false |
render()#
public function render(RenderRequest $request): stringRenders the HTML with mPDF and returns the PDF; with $request->pdfa as PDF/A-3b, with the embedded XML and its Factur-X XMP metadata in the same pass. A line table across pages gets carry-over rows at each page break. Throws a PdfException when mPDF fails.
| Parameter | Type | Description |
|---|---|---|
$request | RenderRequest |
- Returns
string
supportsEmbedding()#
public function supportsEmbedding(): bool- Returns
bool