---
title: "FagusRenderer – API reference · Quittio Docs"
description: "Optional renderer: HTML/CSS to PDF/A-3b with Fagus (package nforst/fagus), an engine for CSS Paged Media that runs as a binary next to PHP."
canonical_url: "https://quittio.dev/en/docs/api/Quittio/Core/Pdf/Renderers/FagusRenderer"
locale: en
meta:
  "og:description": "Optional renderer: HTML/CSS to PDF/A-3b with Fagus (package nforst/fagus), an engine for CSS Paged Media that runs as a binary next to PHP."
  "og:image": "https://quittio.dev/og/docs-en.jpg"
  "og:image:alt": "Quittio documentation: e-invoicing for PHP and Laravel. The installation in the terminal."
  "og:image:height": "630"
  "og:image:type": image/jpeg
  "og:image:width": "1200"
  "og:title": "FagusRenderer – API reference · Quittio Docs"
  "twitter:image": "https://quittio.dev/og/docs-en.jpg"
  "twitter:image:alt": "Quittio documentation: e-invoicing for PHP and Laravel. The installation in the terminal."
---

> Index of every page on this site: [llms.txt](https://quittio.dev/llms.txt)

[API reference](https://quittio.dev/docs/api) / [Quittio](https://quittio.dev/docs/api/Quittio) \\ [Core](https://quittio.dev/docs/api/Quittio/Core) \\ [Pdf](https://quittio.dev/docs/api/Quittio/Core/Pdf) \\ [Renderers](https://quittio.dev/docs/api/Quittio/Core/Pdf/Renderers)

# FagusRenderer

final class in quittio/core · implements [`PdfRenderer`](https://quittio.dev/docs/api/Quittio/Core/Pdf/PdfRenderer)

`Quittio\Core\Pdf\Renderers\FagusRenderer` · [Source](https://github.com/Quittio/quittio/blob/v1.1.0/packages/core/src/Pdf/Renderers/FagusRenderer.php#L32)

Optional renderer: HTML/CSS to PDF/A-3b with Fagus (package nforst/fagus), an engine for CSS Paged Media that runs as a binary next to PHP.

Templates stay written for mPDF: their mPDF markup (page headers and footers, page breaks, named pages, positioned elements, watermark, carry-over rows) is translated into standard CSS before rendering (`MpdfMarkupConverter`). The fonts are the same as for `MpdfRenderer`: the mPDF family names (geist, geistmedium, inter, liberationsans and those of $fonts) map to the font files. PDF/A, the embedded XML and its Factur-X metadata are written by Fagus.

Like mPDF, Fagus never loads anything over the network. It reads no files by itself either: only images that the HTML names by a local path (the logo prepared by LogoCache) are handed over, and only if they are images.

## Methods \#

| Method | Description |
| --- | --- |
| `->__construct()` | |
| `->render()` | Renders the HTML with Fagus and returns the PDF; with $request->pdfa as PDF/A-3b, with the embedded XML as ZUGFeRD/Factur-X (PDF/A-3b, the profile from the conformance level). Throws a PdfException when Fagus fails. |
| `->supportsEmbedding()` | |

### `__construct()`#

```
public function __construct(
    array<string, array<string, string>> $fonts = [],
    list<string> $fontDirectories = [],
    string $defaultFont = 'geist',
    ?string $binary = null,
    float $timeout = 60.0,
)
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$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; directories that do not exist are skipped |
| `$defaultFont` | `string` = `'geist'` | |
| `$binary` | `?string` = `null` | path of the fagus binary; null = FAGUS\_BINARY, the binary installed with the package or fagus on the PATH |
| `$timeout` | `float` = `60.0` | seconds to wait for each answer of the Fagus worker |

### `render()`#

```
public function render(RenderRequest $request): string
```

Renders the HTML with Fagus and returns the PDF; with $request->pdfa as PDF/A-3b, with the embedded XML as ZUGFeRD/Factur-X (PDF/A-3b, the profile from the conformance level). Throws a PdfException when Fagus fails.

| Parameter | Type | Description |
| --- | --- | --- |
| `$request` | `[RenderRequest](https://quittio.dev/docs/api/Quittio/Core/Pdf/RenderRequest)` | |

<dl><dt>Returns</dt>
<dd><code>string</code></dd>
</dl>

### `supportsEmbedding()`#

```
public function supportsEmbedding(): bool
```

<dl><dt>Returns</dt>
<dd><code>bool</code></dd>
</dl>

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://quittio.dev/en#website","@type":"WebSite","description":"E-invoicing for PHP and Laravel: create, validate, read and archive ZUGFeRD, XRechnung and Peppol invoices.","inLanguage":"en","name":"Quittio","url":"https://quittio.dev/en","publisher":{"@id":"https://quittio.dev/#identity"},"translationOfWork":{"@id":"https://quittio.dev/#website"}},{"@id":"https://quittio.dev/docs/api/Quittio/Core/Pdf/Renderers/FagusRenderer#webpage","@type":"WebPage","description":"Optional renderer: HTML/CSS to PDF/A-3b with Fagus (package nforst/fagus), an engine for CSS Paged Media that runs as a binary next to PHP.","name":"FagusRenderer – API reference · Quittio Docs","url":"https://quittio.dev/docs/api/Quittio/Core/Pdf/Renderers/FagusRenderer","isPartOf":{"@id":"https://quittio.dev/en#website"},"potentialAction":[{"@type":"ReadAction","target":["https://quittio.dev/docs/api/Quittio/Core/Pdf/Renderers/FagusRenderer"]}],"primaryImageOfPage":{"@id":"https://quittio.dev/#logo"}},{"@id":"https://quittio.dev/#identity","@type":"Organization","description":"Open-Source-Bibliothek für E-Rechnungen in PHP und Laravel (ZUGFeRD, XRechnung, Peppol) und Quittio Managed.","email":"kontakt@niklasforst.de","legalName":"Niklas Forst – Softwareentwicklung","name":"Quittio","url":"https://quittio.dev","founder":{"@type":"Person","name":"Niklas Forst","url":"https://quittio.dev/ueber"},"logo":{"@id":"https://quittio.dev/#logo"},"sameAs":["https://github.com/Quittio/quittio","https://packagist.org/packages/quittio/quittio"]},{"@id":"https://quittio.dev/#logo","@type":"ImageObject","caption":"Quittio","contentUrl":"https://quittio.dev/logo.png","inLanguage":"en","url":"https://quittio.dev/logo.png"}]}
```