[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"docs:next\u002Fgetting-started":3},{"versions":4,"version":13,"nav":16,"path":22,"page":86},[5,10],{"name":6,"label":7,"prefix":8,"channel":9},"0.1","0.1.0 (latest)","","latest",{"name":11,"label":12,"prefix":11,"channel":11},"next","next (main)",{"name":11,"label":12,"prefix":11,"channel":11,"base":14,"ref":15},"\u002Fdocs\u002Fnext","main",[17,21,24,27,30,33,36,39,42,46,49,52,55,58,61,64,68,71,74,77,80,83],{"slug":18,"title":19,"group":20},"index","Overview","Guide",{"slug":22,"title":23,"group":20},"getting-started","Getting started",{"slug":25,"title":26,"group":20},"php","PHP API",{"slug":28,"title":29,"group":20},"laravel","Laravel",{"slug":31,"title":32,"group":20},"resources","Resources",{"slug":34,"title":35,"group":20},"deployment","Deployment",{"slug":37,"title":38,"group":20},"troubleshooting","Troubleshooting",{"slug":40,"title":41,"group":20},"ai-assistants","Docs for AI assistants",{"slug":43,"title":44,"group":45},"css","CSS reference","Reference",{"slug":47,"title":48,"group":45},"paged-media","Paged media",{"slug":50,"title":51,"group":45},"fonts","Fonts",{"slug":53,"title":54,"group":45},"extensions","Extensions",{"slug":56,"title":57,"group":45},"pdf","The PDF",{"slug":59,"title":60,"group":45},"cli","Command line",{"slug":62,"title":63,"group":45},"rust","Rust library",{"slug":65,"title":66,"group":67},"protocol","Worker protocol","Internals",{"slug":69,"title":70,"group":67},"releasing","Releasing",{"slug":72,"title":73,"group":67},"adr","Architecture decisions",{"slug":75,"title":76,"group":67,"parent":73},"adr\u002F0001-record-architecture-decisions","1. Record architecture decisions",{"slug":78,"title":79,"group":67,"parent":73},"adr\u002F0002-rust-and-fragmentation-in-layout","2. Rust core with fragmentation inside layout",{"slug":81,"title":82,"group":67,"parent":73},"adr\u002F0003-css-parsing-and-own-selector-matching","3. lightningcss for parsing, own selector matching and cascade",{"slug":84,"title":85,"group":67,"parent":73},"adr\u002F0004-extensions-only-where-css-has-no-way","4. Extensions only where CSS has no way",{"title":23,"seoTitle":87,"seoDescription":88,"html":89,"headings":90,"editUrl":111,"sourceUrl":112,"markdownUrl":113,"prev":114,"next":115},"Getting started: your first PDF in PHP or Laravel","Requirements, installing the Composer package nforst\u002Ffagus and the first PDF in PHP and in Laravel. No browser, Node or Docker image to install.","\u003Ch1 id=\"getting-started\">Getting started\u003C\u002Fh1>\n\u003Cp>Fagus turns HTML and CSS into PDF the way Chrome prints them. It is one Composer package,\n\u003Ccode>nforst\u002Ffagus\u003C\u002Fcode>, with a native engine that Composer downloads for your platform. There is no\nbrowser, Node or Docker image to install.\u003C\u002Fp>\n\u003Ch2 id=\"requirements\">Requirements\u003Ca class=\"f-doc-anchor\" href=\"#requirements\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\n\u003Cp>PHP 8.3 or newer, with \u003Ccode>proc_open()\u003C\u002Fcode> allowed (it is unless \u003Ccode>disable_functions\u003C\u002Fcode> lists it).\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\n\u003Cp>One of these platforms:\u003C\u002Fp>\n\u003Ctable class=\"f-doc-table f-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>System\u003C\u002Fth>\n\u003Cth>Architectures\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>Linux with glibc (2.17 or newer)\u003C\u002Ftd>\n\u003Ctd data-label=\"Architectures\">x64, arm64\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Linux with musl (Alpine)\u003C\u002Ftd>\n\u003Ctd data-label=\"Architectures\">x64, arm64\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>macOS\u003C\u002Ftd>\n\u003Ctd data-label=\"Architectures\">x64 (Intel), arm64 (Apple silicon)\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Windows\u003C\u002Ftd>\n\u003Ctd data-label=\"Architectures\">x64\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003C\u002Fli>\n\u003Cli>\n\u003Cp>For the Laravel integration: Laravel 13. Older versions of Laravel conflict with the package.\u003C\u002Fp>\n\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Every platform prints the same PDF from the same input.\u003C\u002Fp>\n\u003Ch2 id=\"install-the-package\">Install the package\u003Ca class=\"f-doc-anchor\" href=\"#install-the-package\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cdiv class=\"f-doc-code\">\u003Cdiv class=\"f-doc-code-bar\">\u003Cspan>sh\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"f-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FFA657\">composer\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> require\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> nforst\u002Ffagus\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>The package contains a Composer plugin. Composer asks once whether you trust it:\u003C\u002Fp>\n\u003Cdiv class=\"f-doc-code\">\u003Cdiv class=\"f-doc-code-bar\">\u003Cspan>text\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"f-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan>Do you trust \"nforst\u002Ffagus\" to execute code and wish to enable it now? (writes \"allow-plugins\" to composer.json) [y,n,d,?]\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>Answer \u003Ccode>y\u003C\u002Fcode>. Composer then writes this to your \u003Ccode>composer.json\u003C\u002Fcode>, which you commit:\u003C\u002Fp>\n\u003Cdiv class=\"f-doc-code\">\u003Cdiv class=\"f-doc-code-bar\">\u003Cspan>json\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"f-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#A5D6FF\">\"config\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#7EE787\">    \"allow-plugins\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#7EE787\">        \"nforst\u002Ffagus\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">true\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    }\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>After every \u003Ccode>composer install\u003C\u002Fcode> and \u003Ccode>composer update\u003C\u002Fcode>, the plugin installs the \u003Ccode>fagus\u003C\u002Fcode> binary of\nthe package's release for the platform Composer runs on:\u003C\u002Fp>\n\u003Col>\n\u003Cli>It works out the target, such as \u003Ccode>x86_64-unknown-linux-gnu\u003C\u002Fcode>, \u003Ccode>aarch64-unknown-linux-musl\u003C\u002Fcode> or\n\u003Ccode>aarch64-apple-darwin\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>It downloads \u003Ccode>fagus-&lt;target&gt;\u003C\u002Fcode> from the GitHub release of the package's version, or takes it\nfrom Composer's cache if it was downloaded before.\u003C\u002Fli>\n\u003Cli>It checks the file's SHA-256 against the sum the package lists for that release\n(\u003Ccode>php\u002Ffagus\u002Fsrc\u002FInternal\u002FRelease.php\u003C\u002Fcode>). A file with another sum is not installed.\u003C\u002Fli>\n\u003Cli>It writes the binary into the package (\u003Ccode>vendor\u002Fnforst\u002Ffagus\u002Fphp\u002Ffagus\u002Fbin\u002Ffagus\u003C\u002Fcode>), where the\nengine looks for it.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>If the binary cannot be installed, Composer does not fail: it prints a warning that starts with\n\u003Ccode>fagus:\u003C\u002Fcode> and goes on. Run \u003Ccode>vendor\u002Fbin\u002Ffagus-install\u003C\u002Fcode> (in Laravel: \u003Ccode>php artisan fagus:install\u003C\u002Fcode>)\nto try again; \u003Ca href=\"\u002Fdocs\u002Fnext\u002Ftroubleshooting\">troubleshooting.md\u003C\u002Fa> lists the messages. Servers without access\nto GitHub, Docker builds and binaries of your own are covered in \u003Ca href=\"\u002Fdocs\u002Fnext\u002Fdeployment\">deployment.md\u003C\u002Fa>.\u003C\u002Fp>\n\u003Ch2 id=\"your-first-pdf-in-php\">Your first PDF in PHP\u003Ca class=\"f-doc-anchor\" href=\"#your-first-pdf-in-php\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cdiv class=\"f-doc-code\">\u003Cdiv class=\"f-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"f-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">&#x3C;?\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">php\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">require\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> 'vendor\u002Fautoload.php'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Fagus\\Fagus\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$html \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> &#x3C;&#x3C;&#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">'HTML'\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#A5D6FF\">&#x3C;!\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">doctype\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> html\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#A5D6FF\">&#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">html\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> lang\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"en\"\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#A5D6FF\">&#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">head\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:4ch;text-indent:-4ch\">\u003Cspan style=\"color:#A5D6FF\">  &#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">title\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>Invoice 2026-0042&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">title\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:4ch;text-indent:-4ch\">\u003Cspan style=\"color:#A5D6FF\">  &#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">style\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    @page\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:8ch;text-indent:-8ch\">\u003Cspan style=\"color:#79C0FF\">      size\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">: A4;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:8ch;text-indent:-8ch\">\u003Cspan style=\"color:#79C0FF\">      margin\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">20\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">mm\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> 18\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">mm\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:8ch;text-indent:-8ch\">\u003Cspan style=\"color:#FF7B72\">      @bottom-right\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> { \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">content\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"Page \"\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> counter\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">page\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">) \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\" of \"\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> counter\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">pages\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">); \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">font-size\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">9\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">pt\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">; }\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#A5D6FF\">    }\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#7EE787\">    body\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> { \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">font-family\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">sans-serif\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">; }\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#7EE787\">    table\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> { \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">width\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">100\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">%\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">; \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">border-collapse\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">collapse\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">; }\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#7EE787\">    th\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">, \u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">td\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> { \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">border-bottom\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">1\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">px\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> solid\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> #ddd\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">; \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">padding\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">4\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">px\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">; \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">text-align\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">left\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">; }\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:4ch;text-indent:-4ch\">\u003Cspan style=\"color:#A5D6FF\">  &#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">style\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#A5D6FF\">&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">head\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#A5D6FF\">&#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">body\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:4ch;text-indent:-4ch\">\u003Cspan style=\"color:#A5D6FF\">  &#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">h1\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>Invoice 2026-0042&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">h1\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:4ch;text-indent:-4ch\">\u003Cspan style=\"color:#A5D6FF\">  &#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">table\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#A5D6FF\">    &#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">thead\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>&#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">tr\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>&#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">th\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>Item&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">th\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>&#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">th\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>Amount&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">th\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">tr\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">thead\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#A5D6FF\">    &#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">tbody\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>&#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">tr\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>&#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">td\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>Consulting&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">td\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>&#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">td\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>1,200.00 EUR&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">td\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">tr\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">tbody\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:4ch;text-indent:-4ch\">\u003Cspan style=\"color:#A5D6FF\">  &#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">table\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#A5D6FF\">&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">body\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#A5D6FF\">&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">html\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">HTML\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$pdf \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Fagus\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">html\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($html)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">save\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'invoice.pdf'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">);\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#79C0FF\">echo\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $pdf\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">pages\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">();          \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F 1\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#79C0FF\">print_r\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($pdf\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">diagnostics\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">()); \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F CSS that was ignored, resources that are missing\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>The document describes itself, as in a browser: the page size and margins come from \u003Ccode>@page\u003C\u002Fcode>, the\nPDF's title from \u003Ccode>&lt;title&gt;\u003C\u002Fcode> and its language from \u003Ccode>&lt;html lang&gt;\u003C\u002Fcode>. Without an \u003Ccode>@page\u003C\u002Fcode> rule, pages are\nA4 (Chrome uses the paper size of its printer settings, often Letter).\u003C\u002Fp>\n\u003Cp>The first document starts the engine's worker process, which takes a few milliseconds; the\nfollowing documents of the same PHP process render on the running worker.\u003C\u002Fp>\n\u003Ch3 id=\"images-stylesheets-and-fonts-from-files\">Images, stylesheets and fonts from files\u003Ca class=\"f-doc-anchor\" href=\"#images-stylesheets-and-fonts-from-files\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>Fagus reads no files unless you name a directory. Relative URLs resolve against the base\ndirectory, and only files inside it are read:\u003C\u002Fp>\n\u003Cdiv class=\"f-doc-code\">\u003Cdiv class=\"f-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"f-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$pdf \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Fagus\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">html\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($html)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">baseDirectory\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">__DIR__\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">.\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'\u002Fresources\u002Fpdf'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)   \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F &#x3C;img src=\"logo.png\">, &#x3C;link href=\"invoice.css\">\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">render\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">();\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>URLs with \u003Ccode>http:\u003C\u002Fcode> or \u003Ccode>https:\u003C\u002Fcode> are never fetched. \u003Ca href=\"\u002Fdocs\u002Fnext\u002Fresources\">resources.md\u003C\u002Fa> describes where\nresources come from and how to hand them over.\u003C\u002Fp>\n\u003Ch2 id=\"your-first-pdf-in-laravel\">Your first PDF in Laravel\u003Ca class=\"f-doc-anchor\" href=\"#your-first-pdf-in-laravel\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Laravel 13 discovers the package on its own: the \u003Ccode>Fagus\u003C\u002Fcode> facade, Blade views, responses and\nfilesystem disks work after \u003Ccode>composer require\u003C\u002Fcode>. Write the document as a Blade view, for example\n\u003Ccode>resources\u002Fviews\u002Finvoices\u002Fshow.blade.php\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cdiv class=\"f-doc-code\">\u003Cdiv class=\"f-doc-code-bar\">\u003Cspan>blade\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"f-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">&#x3C;!\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">doctype\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> html\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">&#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">html\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> lang\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"en\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">&#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">head\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:4ch;text-indent:-4ch\">\u003Cspan style=\"color:#E6EDF3\">  &#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">title\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>Invoice \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">{{\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $invoice\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">number \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">}}\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">title\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:4ch;text-indent:-4ch\">\u003Cspan style=\"color:#E6EDF3\">  &#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">style\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    @page\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> { \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">size\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: A4; \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">margin\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">20\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">mm\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> 18\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">mm\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">; }\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:4ch;text-indent:-4ch\">\u003Cspan style=\"color:#E6EDF3\">  &#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">style\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">head\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">&#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">body\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:4ch;text-indent:-4ch\">\u003Cspan style=\"color:#E6EDF3\">  &#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">img\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> src\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"\u002Fimages\u002Flogo.png\"\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> alt\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"ACME\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:4ch;text-indent:-4ch\">\u003Cspan style=\"color:#E6EDF3\">  &#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">h1\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>Invoice \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">{{\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $invoice\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">number \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">}}\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">h1\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">body\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">html\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>and return it from a controller:\u003C\u002Fp>\n\u003Cdiv class=\"f-doc-code\">\u003Cdiv class=\"f-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"f-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> App\\Models\\Invoice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Fagus\\Laravel\\Facades\\Fagus\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">class\u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\"> InvoicePdfController\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">{\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    public\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> function\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> __invoke\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Invoice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $invoice)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        return\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Fagus\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">view\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'invoices.show'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, [\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'invoice'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $invoice])\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:14ch;text-indent:-14ch\">\u003Cspan style=\"color:#FF7B72\">            ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">name\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"invoice-{\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">$invoice\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">number\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">}.pdf\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">);   \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F shown in the browser\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    }\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>The browser shows the PDF. \u003Ccode>-&gt;download()\u003C\u002Fcode> sends it as a download, and \u003Ccode>-&gt;store()\u003C\u002Fcode> writes it to a\nfilesystem disk:\u003C\u002Fp>\n\u003Cdiv class=\"f-doc-code\">\u003Cdiv class=\"f-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"f-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#79C0FF\">Fagus\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">view\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'invoices.show'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, [\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'invoice'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $invoice])\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">download\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'invoice.pdf'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">);\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#79C0FF\">Fagus\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">view\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'invoices.show'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, [\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'invoice'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $invoice])\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">store\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'invoices\u002F2026-0042.pdf'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'s3'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">);\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>In Laravel, relative URLs resolve against \u003Ccode>public\u002F\u003C\u002Fcode>, so \u003Ccode>\u002Fimages\u002Flogo.png\u003C\u002Fcode> is\n\u003Ccode>public\u002Fimages\u002Flogo.png\u003C\u002Fcode>. Publish the configuration to change this and the fonts:\u003C\u002Fp>\n\u003Cdiv class=\"f-doc-code\">\u003Cdiv class=\"f-doc-code-bar\">\u003Cspan>sh\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"f-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FFA657\">php\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> artisan\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> vendor:publish\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> --tag=fagus-config\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>Use the facade \u003Ccode>Fagus\\Laravel\\Facades\\Fagus\u003C\u002Fcode> in Laravel, not the class \u003Ccode>Fagus\\Fagus\u003C\u002Fcode>: the facade\nrenders with the engine and the settings of \u003Ccode>config\u002Ffagus.php\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Ch2 id=\"where-to-go-next\">Where to go next\u003Ca class=\"f-doc-anchor\" href=\"#where-to-go-next\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\u003Ca href=\"\u002Fdocs\u002Fnext\u002Fphp\">php.md\u003C\u002Fa>: every method of the PHP API.\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"\u002Fdocs\u002Fnext\u002Flaravel\">laravel.md\u003C\u002Fa>: views, responses, disks, queues, Octane and the configuration.\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"\u002Fdocs\u002Fnext\u002Fresources\">resources.md\u003C\u002Fa>: images, stylesheets, fonts and frames, and what Fagus never reads.\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"\u002Fdocs\u002Fnext\u002Fpaged-media\">paged-media.md\u003C\u002Fa>: page sizes, margins, headers, footers and page numbers.\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"\u002Fdocs\u002Fnext\u002Fcss\">css.md\u003C\u002Fa>: the CSS that Fagus renders.\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"\u002Fdocs\u002Fnext\u002Ffonts\">fonts.md\u003C\u002Fa>: web fonts, font directories and system fonts.\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"\u002Fdocs\u002Fnext\u002Fpdf\">pdf.md\u003C\u002Fa>: PDF\u002FA, PDF\u002FUA, attachments and ZUGFeRD\u002FFactur-X invoices.\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"\u002Fdocs\u002Fnext\u002Fdeployment\">deployment.md\u003C\u002Fa>: Docker, Alpine, servers without GitHub access and worker processes.\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"\u002Fdocs\u002Fnext\u002Ftroubleshooting\">troubleshooting.md\u003C\u002Fa>: error messages, diagnostics and differences from Chrome.\u003C\u002Fli>\n\u003C\u002Ful>\n",[91,95,98,101,105,108],{"id":92,"text":93,"level":94},"requirements","Requirements",2,{"id":96,"text":97,"level":94},"install-the-package","Install the package",{"id":99,"text":100,"level":94},"your-first-pdf-in-php","Your first PDF in PHP",{"id":102,"text":103,"level":104},"images-stylesheets-and-fonts-from-files","Images, stylesheets and fonts from files",3,{"id":106,"text":107,"level":94},"your-first-pdf-in-laravel","Your first PDF in Laravel",{"id":109,"text":110,"level":94},"where-to-go-next","Where to go next","https:\u002F\u002Fgithub.com\u002Fnforst\u002Ffagus\u002Fedit\u002Fmain\u002Fdocs\u002Fgetting-started.md","https:\u002F\u002Fgithub.com\u002Fnforst\u002Ffagus\u002Fblob\u002Fmain\u002Fdocs\u002Fgetting-started.md","\u002Fdocs\u002Fnext\u002Fgetting-started.md",{"slug":18,"title":19},{"slug":25,"title":26}]