Zum Inhalt springen

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()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,
)
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

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.

ParameterTypeDescription
$requestRenderRequest
Returns
string

supportsEmbedding()#

public function supportsEmbedding(): bool
Returns
bool

Die Open-Core-Pakete stehen unter der MIT-Lizenz. Die rechtlichen Formulierungen der Länderpakete sind mit einer Steuerberatung abzustimmen.