Skip to content

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#

MethodDescription
->__construct()
->render()
->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,
)
ParameterTypeDescription
$tempDir?string = null
$fontsarray<string, array<string, string>> = []additional fonts: family => [R => file, B => file, I => file, BI => file]
$fontDirectorieslist<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
$defaultFontstring = 'geist'
$pdfaAutobool = false
$simpleTablesbool = false

render()#

public function render(RenderRequest $request): string
ParameterTypeDescription
$requestRenderRequest
Returns
string

supportsEmbedding()#

public function supportsEmbedding(): bool
Returns
bool

The open core packages are MIT licensed. The legal wording of the country packs must be confirmed by a tax adviser.