[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"docs:resources":3},{"versions":4,"version":13,"nav":16,"path":31,"page":80},[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":6,"label":7,"prefix":8,"channel":9,"base":14,"ref":15},"\u002Fdocs","v0.1.0",[17,21,24,27,30,33,36,39,43,46,49,52,55,58,61,65,68,71,74,77],{"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":42},"css","CSS reference","Reference",{"slug":44,"title":45,"group":42},"paged-media","Paged media",{"slug":47,"title":48,"group":42},"fonts","Fonts",{"slug":50,"title":51,"group":42},"extensions","Extensions",{"slug":53,"title":54,"group":42},"pdf","The PDF",{"slug":56,"title":57,"group":42},"cli","Command line",{"slug":59,"title":60,"group":42},"rust","Rust library",{"slug":62,"title":63,"group":64},"protocol","Worker protocol","Internals",{"slug":66,"title":67,"group":64},"releasing","Releasing",{"slug":69,"title":70,"group":64},"adr\u002F0001-record-architecture-decisions","1. Record architecture decisions",{"slug":72,"title":73,"group":64},"adr\u002F0002-rust-and-fragmentation-in-layout","2. Rust core with fragmentation inside layout",{"slug":75,"title":76,"group":64},"adr\u002F0003-css-parsing-and-own-selector-matching","3. lightningcss for parsing, own selector matching and cascade",{"slug":78,"title":79,"group":64},"adr\u002F0004-extensions-only-where-css-has-no-way","4. Extensions only where CSS has no way",{"title":32,"seoTitle":81,"seoDescription":82,"html":83,"headings":84,"editUrl":126,"sourceUrl":127,"markdownUrl":128,"prev":129,"next":130},"Resources: images, stylesheets, fonts and frames","Where images, style sheets, fonts and frames come from, and what Fagus never loads: no network access, no files outside the directory you allow, no scripts.","\u003Ch1 id=\"resources\">Resources\u003C\u002Fh1>\n\u003Cp>A document refers to other files: images, stylesheets, fonts, SVG sprites, the documents of\nframes. Fagus loads them only from places you allow. It never goes to the network, never reads a\nfile outside the directory you name, and runs no scripts. This page describes where resources\ncome from, and so the security model.\u003C\u002Fp>\n\u003Ch2 id=\"where-a-resource-comes-from\">Where a resource comes from\u003Ca class=\"f-doc-anchor\" href=\"#where-a-resource-comes-from\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>For every URL in a document, Fagus tries these sources in this order and takes the first that has\nthe resource:\u003C\u002Fp>\n\u003Col>\n\u003Cli>\u003Cstrong>A \u003Ccode>data:\u003C\u002Fcode> URL\u003C\u002Fstrong>: the data in the URL itself, base64 or percent-encoded.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>The resources handed over\u003C\u002Fstrong> with \u003Ccode>resource($url, $data)\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>The resolver\u003C\u002Fstrong> set with \u003Ccode>resolver()\u003C\u002Fcode>, a PHP callback.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>A file inside the root directory\u003C\u002Fstrong>, if a base directory is set.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>If none has it, the resource is missing: the document renders without it and the PDF's\ndiagnostics say so (\u003Ccode>resource.not-loaded\u003C\u002Fcode>).\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>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">resource\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'logo.png'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, $tenant\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">logo)\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\">resolver\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">fn\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> (\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">string\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $url)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">:\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> ?string\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> => $media\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">find\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($url))\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\u003Ch2 id=\"read-files-from-a-base-directory\">Read files from a base directory\u003Ca class=\"f-doc-anchor\" href=\"#read-files-from-a-base-directory\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Without a base directory, Fagus reads no files at all. With one, relative URLs resolve against\nit, 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:#79C0FF\">Fagus\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">html\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'&#x3C;link rel=\"stylesheet\" href=\"css\u002Finvoice.css\">&#x3C;img src=\"images\u002Flogo.png\" alt=\"ACME\">'\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\">    ->\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>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#8B949E\">\u002F\u002F reads resources\u002Fpdf\u002Fcss\u002Finvoice.css and resources\u002Fpdf\u002Fimages\u002Flogo.png\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>A query or fragment (\u003Ccode>logo.png?v=2\u003C\u002Fcode>, \u003Ccode>icons.svg#check\u003C\u002Fcode>) is not part of the file name. Percent\nescapes are decoded (\u003Ccode>my%20logo.png\u003C\u002Fcode> is \u003Ccode>my logo.png\u003C\u002Fcode>).\u003C\u002Fp>\n\u003Cp>In Laravel the base directory is \u003Ccode>public\u002F\u003C\u002Fcode> unless \u003Ccode>base_directory\u003C\u002Fcode> in \u003Ccode>config\u002Ffagus.php\u003C\u002Fcode> says\notherwise.\u003C\u002Fp>\n\u003Ch2 id=\"allow-a-larger-directory-with-root\">Allow a larger directory with \u003Ccode>root()\u003C\u002Fcode>\u003Ca class=\"f-doc-anchor\" href=\"#allow-a-larger-directory-with-root\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>The root is the directory that files may come from. It is the base directory unless you set it\nwith \u003Ccode>root()\u003C\u002Fcode>, and it must contain the base directory. Use it when the document's URLs lead out of\nits own directory:\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\">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\u002Finvoices'\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\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">root\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>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cdiv class=\"f-doc-code\">\u003Cdiv class=\"f-doc-code-bar\">\u003Cspan>html\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:#8B949E\">&#x3C;!-- resources\u002Fpdf\u002Finvoices\u002Finvoice.html -->\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\">link\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> rel\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"stylesheet\"\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> href\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"..\u002Fshared\u002Fbase.css\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>  \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">&#x3C;!-- resources\u002Fpdf\u002Fshared\u002Fbase.css -->\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>Anything that leads outside the root is refused: \u003Ccode>..\u003C\u002Fcode> past the root, absolute file paths\n(\u003Ccode>\u002Fetc\u002Fpasswd\u003C\u002Fcode> is looked up as \u003Ccode>&lt;root&gt;\u002Fetc\u002Fpasswd\u003C\u002Fcode>), and symbolic links that point outside it.\u003C\u002Fp>\n\u003Ch2 id=\"urls-that-start-with-\">URLs that start with \u003Ccode>\u002F\u003C\u002Fcode>\u003Ca class=\"f-doc-anchor\" href=\"#urls-that-start-with-\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>A URL that starts with \u003Ccode>\u002F\u003C\u002Fcode> resolves against the root, as on a web server:\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\">html\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'&#x3C;img src=\"\u002Fimages\u002Flogo.png\" alt=\"ACME\">'\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\">    ->\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\">'\u002Fpublic\u002Finvoices'\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\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">root\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\">'\u002Fpublic'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">);   \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F reads public\u002Fimages\u002Flogo.png\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>Without \u003Ccode>root()\u003C\u002Fcode>, it resolves against the base directory. In Laravel, with the base directory at\n\u003Ccode>public\u002F\u003C\u002Fcode>, the same markup works in a page of the site and in the PDF.\u003C\u002Fp>\n\u003Ch2 id=\"hand-over-data-with-resource\">Hand over data with \u003Ccode>resource()\u003C\u002Fcode>\u003Ca class=\"f-doc-anchor\" href=\"#hand-over-data-with-resource\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>\u003Ccode>resource($url, $data)\u003C\u002Fcode> gives Fagus the data for a URL, so it does not have to be a file: a logo\nfrom the database, a chart drawn in PHP, a stylesheet built at runtime.\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\">html\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'&#x3C;img src=\"logo.png\" alt=\"ACME\">&#x3C;img src=\"chart.svg\" alt=\"Revenue by month\">'\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\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">resource\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'logo.png'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, $company\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">logo_png)\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\">resource\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'chart.svg'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, $chart\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">toSvg\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">());\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>The URL must match the URL that Fagus asks for:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>In the document, that is the URL as written in the attribute: \u003Ccode>&lt;img src=&quot;logo.png&quot;&gt;\u003C\u002Fcode> asks for\n\u003Ccode>logo.png\u003C\u002Fcode>, \u003Ccode>&lt;img src=&quot;.\u002Flogo.png&quot;&gt;\u003C\u002Fcode> for \u003Ccode>.\u002Flogo.png\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>In a stylesheet that was loaded from a URL (\u003Ccode>&lt;link href=&quot;css\u002Fmain.css&quot;&gt;\u003C\u002Fcode>, \u003Ccode>@import\u003C\u002Fcode>), relative\nURLs are resolved against the stylesheet first, as in browsers: \u003Ccode>url(img\u002Fbg.png)\u003C\u002Fcode> in\n\u003Ccode>css\u002Fmain.css\u003C\u002Fcode> asks for \u003Ccode>css\u002Fimg\u002Fbg.png\u003C\u002Fcode>, and \u003Ccode>@import &quot;more.css&quot;\u003C\u002Fcode> there for \u003Ccode>css\u002Fmore.css\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>In a frame's document (\u003Ccode>&lt;iframe src=&quot;frames\u002Fpage.html&quot;&gt;\u003C\u002Fcode>), relative URLs are resolved against\nthe frame's URL: \u003Ccode>style.css\u003C\u002Fcode> in \u003Ccode>frames\u002Fpage.html\u003C\u002Fcode> asks for \u003Ccode>frames\u002Fstyle.css\u003C\u002Fcode>.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Resources handed over work without a base directory. They are also the only way, besides\n\u003Ccode>data:\u003C\u002Fcode> URLs and the resolver, to provide resources for a document that has no files.\u003C\u002Fp>\n\u003Ch2 id=\"answer-requests-with-resolver\">Answer requests with \u003Ccode>resolver()\u003C\u002Fcode>\u003Ca class=\"f-doc-anchor\" href=\"#answer-requests-with-resolver\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>A resolver is a callback that gets each URL that was not handed over, as described above, and\nreturns its data or \u003Ccode>null\u003C\u002Fcode>:\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\">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:#D2A8FF\">resource_path\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'pdf'\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\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">resolver\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">function\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> (\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">string\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $url)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">:\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> ?string\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        if\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> (\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">!\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> str_starts_with\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($url, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'media:\u002F\u002F'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)) {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:14ch;text-indent:-14ch\">\u003Cspan style=\"color:#FF7B72\">            return\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> null\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;   \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F let Fagus look for a file\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\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:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        return\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Storage\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">disk\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'media'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">get\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">substr\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($url, \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">strlen\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'media:\u002F\u002F'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)));\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    });\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>Fagus asks the resolver before it looks for a file; after \u003Ccode>null\u003C\u002Fcode>, it tries the file in the root.\nThe resolver sees every URL the document refers to that is not a \u003Ccode>data:\u003C\u002Fcode> URL or handed over,\nincluding \u003Ccode>https:\u002F\u002F…\u003C\u002Fcode> URLs. It decides what to hand out. Fagus does not go to the network, but\nyour resolver may, under your own rules: check the host against a list, set a timeout, and keep\nin mind that a document from user input can name any URL.\u003C\u002Fp>\n\u003Cp>The engine waits while the callback runs; the \u003Ca href=\"\u002Fdocs\u002Fdeployment#timeouts\">timeout\u003C\u002Fa> does not count\nthat time, as it limits the wait for the worker's answers.\u003C\u002Fp>\n\u003Ch2 id=\"data-urls\">\u003Ccode>data:\u003C\u002Fcode> URLs\u003Ca class=\"f-doc-anchor\" href=\"#data-urls\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>\u003Ccode>data:\u003C\u002Fcode> URLs work everywhere a URL does, base64 or percent-encoded:\u003C\u002Fp>\n\u003Cdiv class=\"f-doc-code\">\u003Cdiv class=\"f-doc-code-bar\">\u003Cspan>html\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\">img\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> src\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"data:image\u002Fpng;base64,iVBORw0KGgoAAAANSUhEUgAA…\"\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> alt\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"\"\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\">link\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> rel\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"stylesheet\"\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> href\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"data:text\u002Fcss,p%20%7B%20color%3A%20navy%20%7D\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>In PHP:\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\">$src \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> 'data:image\u002Fpng;base64,'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">.\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">base64_encode\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($png);\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>A document of a frame that comes from a \u003Ccode>data:\u003C\u002Fcode> URL loads nothing else.\u003C\u002Fp>\n\u003Ch2 id=\"images\">Images\u003Ca class=\"f-doc-anchor\" href=\"#images\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>\u003Ccode>&lt;img&gt;\u003C\u002Fcode>, \u003Ccode>&lt;picture&gt;\u003C\u002Fcode> and \u003Ccode>srcset\u003C\u002Fcode>, CSS backgrounds, \u003Ccode>mask\u003C\u002Fcode>, \u003Ccode>list-style-image\u003C\u002Fcode>, \u003Ccode>border-image\u003C\u002Fcode>,\n\u003Ccode>content: url()\u003C\u002Fcode>, and SVG clip paths, masks, filters and \u003Ccode>&lt;use href=&quot;sprite.svg#id&quot;&gt;\u003C\u002Fcode> in other\nfiles load as resources.\u003C\u002Fp>\n\u003Ctable class=\"f-doc-table f-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Format\u003C\u002Fth>\n\u003Cth>Notes\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>PNG\u003C\u002Ftd>\n\u003Ctd data-label=\"Notes\">Also with \u003Ccode>gAMA\u003C\u002Fcode>, converted to sRGB as Chrome converts them.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>JPEG\u003C\u002Ftd>\n\u003Ctd data-label=\"Notes\">CMYK JPEGs without a profile are converted to sRGB as in Chrome.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>GIF\u003C\u002Ftd>\n\u003Ctd data-label=\"Notes\">\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>WebP\u003C\u002Ftd>\n\u003Ctd data-label=\"Notes\">\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>SVG\u003C\u002Ftd>\n\u003Ctd data-label=\"Notes\">Drawn as vector graphics. An SVG image does not see the document's \u003Ccode>@font-face\u003C\u002Fcode> fonts; its own \u003Ccode>@font-face\u003C\u002Fcode> rules load fonts only from \u003Ccode>data:\u003C\u002Fcode> URLs, as in Chrome.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>JPEG, PNG and WebP photos stand as their EXIF orientation says. \u003Ccode>&lt;picture&gt;\u003C\u002Fcode> sources and \u003Ccode>srcset\u003C\u002Fcode>\nare chosen as Chrome chooses them; AVIF and JPEG XL sources are skipped, as Fagus cannot decode\nthem.\u003C\u002Fp>\n\u003Cp>An image that cannot be used is left out, and a diagnostic says why:\u003C\u002Fp>\n\u003Ctable class=\"f-doc-table f-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Code\u003C\u002Fth>\n\u003Cth>Message\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>resource.not-loaded\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Message\">image \u003Ccode>…\u003C\u002Fcode> could not be loaded\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>image.unsupported\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Message\">image \u003Ccode>…\u003C\u002Fcode> is not a PNG, JPEG, GIF, WebP or SVG image\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>image.unsupported\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Message\">image \u003Ccode>…\u003C\u002Fcode> is not a valid SVG image\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>image.too-large\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Message\">image \u003Ccode>…\u003C\u002Fcode> has more than 200 megapixels\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>image.broken\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Message\">image \u003Ccode>…\u003C\u002Fcode> could not be decoded and is left out\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Ch2 id=\"stylesheets\">Stylesheets\u003Ca class=\"f-doc-anchor\" href=\"#stylesheets\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Stylesheets come from \u003Ccode>&lt;style&gt;\u003C\u002Fcode> elements, \u003Ccode>&lt;link rel=&quot;stylesheet&quot; href=&quot;…&quot;&gt;\u003C\u002Fcode>, \u003Ccode>@import\u003C\u002Fcode> and\n\u003Ccode>stylesheet()\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cdiv class=\"f-doc-code\">\u003Cdiv class=\"f-doc-code-bar\">\u003Cspan>html\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\">link\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> rel\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"stylesheet\"\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> href\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"css\u002Finvoice.css\"\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\">style\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:4ch;text-indent:-4ch\">\u003Cspan style=\"color:#FF7B72\">  @import\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> url\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"css\u002Fprint.css\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">) \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">print\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:4ch;text-indent:-4ch\">\u003Cspan style=\"color:#FF7B72\">  @import\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> \"css\u002Ftheme.css\"\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> layer\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">theme\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\">style\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cul>\n\u003Cli>A linked stylesheet loads as a resource. One that cannot be loaded is reported:\n\u003Ccode>html:4: warning[resource.not-loaded]: stylesheet \u003C\u002Fcode>css\u002Fmissing.css\u003Ccode> could not be loaded\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>\u003Ccode>@import\u003C\u002Fcode> loads its stylesheet as a resource, with the media queries, \u003Ccode>supports()\u003C\u002Fcode> condition\nand \u003Ccode>layer()\u003C\u002Fcode> of its rule, up to eight levels deep. One that cannot be loaded is reported as\n&quot;stylesheet \u003Ccode>…\u003C\u002Fcode> could not be imported&quot;.\u003C\u002Fli>\n\u003Cli>Relative URLs in a linked or imported stylesheet resolve against the stylesheet's URL.\u003C\u002Fli>\n\u003Cli>\u003Ccode>stylesheet($css)\u003C\u002Fcode> adds CSS from PHP after the document's stylesheets. Its relative URLs\nresolve against the base directory.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"fonts\">Fonts\u003Ca class=\"f-doc-anchor\" href=\"#fonts\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>\u003Ccode>@font-face\u003C\u002Fcode> rules load their fonts as resources: TTF, OTF, WOFF and WOFF2, with variable fonts\nand \u003Ccode>unicode-range\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cdiv class=\"f-doc-code\">\u003Cdiv class=\"f-doc-code-bar\">\u003Cspan>css\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\">@font-face\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:4ch;text-indent:-4ch\">\u003Cspan style=\"color:#79C0FF\">  font-family\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"Corporate Sans\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:4ch;text-indent:-4ch\">\u003Cspan style=\"color:#79C0FF\">  src\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">url\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"fonts\u002FCorporateSans.woff2\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">) \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">format\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"woff2\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">);\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:4ch;text-indent:-4ch\">\u003Cspan style=\"color:#79C0FF\">  font-weight\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">100\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> 900\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\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>Fagus loads the first source that Chrome would load and passes over formats and technologies\nChrome does not load. A font that cannot be loaded is reported (&quot;font \u003Ccode>…\u003C\u002Fcode> could not be loaded&quot;),\none that is not a font Fagus can read too (&quot;\u003Ccode>…\u003C\u002Fcode> is not a font Fagus can read&quot;,\n\u003Ccode>font.unsupported\u003C\u002Fcode>). Fonts from directories, generic families and system fonts are described in\n\u003Ca href=\"\u002Fdocs\u002Ffonts\">fonts.md\u003C\u002Fa>.\u003C\u002Fp>\n\u003Ch2 id=\"frames-iframe-object-and-embed\">Frames: \u003Ccode>&lt;iframe&gt;\u003C\u002Fcode>, \u003Ccode>&lt;object&gt;\u003C\u002Fcode> and \u003Ccode>&lt;embed&gt;\u003C\u002Fcode>\u003Ca class=\"f-doc-anchor\" href=\"#frames-iframe-object-and-embed\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>An \u003Ccode>&lt;iframe&gt;\u003C\u002Fcode> (its \u003Ccode>srcdoc\u003C\u002Fcode>, else its \u003Ccode>src\u003C\u002Fcode>), and an \u003Ccode>&lt;object&gt;\u003C\u002Fcode> or \u003Ccode>&lt;embed&gt;\u003C\u002Fcode> whose resource is an\nHTML document, shows that document as Chrome prints it: laid out at the frame's size, not\npaginated, cut off at the frame's edges.\u003C\u002Fp>\n\u003Cdiv class=\"f-doc-code\">\u003Cdiv class=\"f-doc-code-bar\">\u003Cspan>html\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\">iframe\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> src\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"frames\u002Fterms.html\"\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> style\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"width: 100%; height: 120mm; border: 0\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">iframe\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\">iframe\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> srcdoc\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"\u003C\u002Fspan>\u003Cspan style=\"color:#FFA198;font-style:italic\">&#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">p>Inline document\u003C\u002Fspan>\u003Cspan style=\"color:#FFA198;font-style:italic\">&#x3C;\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\u002Fp>\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>&#x3C;\u002F\u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">iframe\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">>\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>A frame's document loads like any other resource: a \u003Ccode>data:\u003C\u002Fcode> URL, the resources handed over, the\nresolver, or a file inside the root. Its own relative URLs resolve against its URL. Scripts in it\ndo not run. Frames nest at most 8 deep, and one render lays out at most 256 documents in frames\nwith 8 MiB of markup together; past that limit, frames show nothing and a \u003Ccode>frame.limit\u003C\u002Fcode> warning\nsays so. The diagnostics of documents in frames are not reported.\u003C\u002Fp>\n\u003Cp>Text files and images in frames show as Chrome shows them.\u003C\u002Fp>\n\u003Ch2 id=\"what-is-never-loaded\">What is never loaded\u003Ca class=\"f-doc-anchor\" href=\"#what-is-never-loaded\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\u003Cstrong>The network.\u003C\u002Fstrong> URLs with \u003Ccode>http:\u003C\u002Fcode>, \u003Ccode>https:\u003C\u002Fcode>, \u003Ccode>ftp:\u003C\u002Fcode> or a host (\u003Ccode>\u002F\u002Fcdn.example.com\u002F…\u003C\u002Fcode>) are\nnever fetched by Fagus. Only a resolver of yours can answer them.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Files outside the root\u003C\u002Fstrong>, through \u003Ccode>..\u003C\u002Fcode>, absolute paths or symbolic links. A URL with a scheme\n(\u003Ccode>file:\u002F\u002F\u002Fetc\u002Fpasswd\u003C\u002Fcode>) is never read as a file.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Files at all\u003C\u002Fstrong>, when no base directory is set.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Scripts.\u003C\u002Fstrong> \u003Ccode>&lt;script&gt;\u003C\u002Fcode> does not run, and neither do event handlers or \u003Ccode>javascript:\u003C\u002Fcode> URLs.\nContent that a script would create in a browser, such as a chart drawn by JavaScript, is\nmissing. Render it on the server as SVG or an image and hand it over.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Links (\u003Ccode>&lt;a href=&quot;https:\u002F\u002F…&quot;&gt;\u003C\u002Fcode>) are different: they become links in the PDF and load nothing.\u003C\u002Fp>\n\u003Ch2 id=\"diagnostics-for-missing-resources\">Diagnostics for missing resources\u003Ca class=\"f-doc-anchor\" href=\"#diagnostics-for-missing-resources\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Every resource that is missing shows in \u003Ccode>$pdf-&gt;diagnostics()\u003C\u002Fcode>:\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>\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\">'\u002Fassets'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">render\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\">foreach\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:#FF7B72\">as\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $diagnostic) {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#79C0FF\">    echo\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $diagnostic, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">\\n\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"\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\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\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>html:4: warning[resource.not-loaded]: stylesheet `css\u002Fmissing.css` could not be loaded\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan>resources: warning[resource.not-loaded]: image `https:\u002F\u002Fexample.com\u002Fa.png` could not be loaded\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan>resources: warning[resource.not-loaded]: image `..\u002Foutside\u002Fx.png` could not be loaded\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>With \u003Ccode>strict()\u003C\u002Fcode>, any diagnostic makes \u003Ccode>render()\u003C\u002Fcode> throw a \u003Ccode>RenderException\u003C\u002Fcode> instead, which helps\nto catch missing files in tests. Long \u003Ccode>data:\u003C\u002Fcode> URLs are cut short in the messages.\u003C\u002Fp>\n\u003Ch2 id=\"laravel-assets-and-vite\">Laravel: assets and Vite\u003Ca class=\"f-doc-anchor\" href=\"#laravel-assets-and-vite\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>\u003Ccode>asset()\u003C\u002Fcode>, \u003Ccode>url()\u003C\u002Fcode>, \u003Ccode>Vite::asset()\u003C\u002Fcode> and \u003Ccode>@vite\u003C\u002Fcode> write absolute URLs with the host of the\napplication (\u003Ccode>https:\u002F\u002Fexample.com\u002Fbuild\u002Fassets\u002Fapp-4ed993c7.css\u003C\u002Fcode>), which Fagus does not fetch.\nUse one of these instead:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\n\u003Cp>Root-relative URLs in the view, which resolve against \u003Ccode>public\u002F\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\">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>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003C\u002Fli>\n\u003Cli>\n\u003Cp>The built CSS, handed over as a stylesheet:\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\"> Illuminate\\Support\\Facades\\Vite\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\">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\">, $data)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">stylesheet\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Vite\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">content\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'resources\u002Fcss\u002Fpdf.css'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">));\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003C\u002Fli>\n\u003Cli>\n\u003Cp>A resolver that maps the application's URLs to files in \u003Ccode>public\u002F\u003C\u002Fcode>, and only to those:\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\">, $data)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">resolver\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">function\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> (\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">string\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $url)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">:\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> ?string\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    $prefix \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> rtrim\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">config\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'app.url'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">), \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'\u002F'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">.\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'\u002F'\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\">    if\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> (\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">!\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> str_starts_with\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($url, $prefix)) {\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\"> null\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\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:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    $public \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> realpath\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">public_path\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">());\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    $file \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> realpath\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">public_path\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">parse_url\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($url, \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">PHP_URL_PATH\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">) \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">??\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> ''\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:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    return\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $file \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">!==\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> false\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> &#x26;&#x26;\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> str_starts_with\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($file, $public\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">.\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">DIRECTORY_SEPARATOR\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">) \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">&#x26;&#x26;\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> is_file\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($file)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        ?\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> file_get_contents\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($file)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        :\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> null\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\">});\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003C\u002Fli>\n\u003C\u002Ful>\n",[85,89,92,95,98,101,104,107,110,113,114,117,120,123],{"id":86,"text":87,"level":88},"where-a-resource-comes-from","Where a resource comes from",2,{"id":90,"text":91,"level":88},"read-files-from-a-base-directory","Read files from a base directory",{"id":93,"text":94,"level":88},"allow-a-larger-directory-with-root","Allow a larger directory with root()",{"id":96,"text":97,"level":88},"urls-that-start-with-","URLs that start with \u002F",{"id":99,"text":100,"level":88},"hand-over-data-with-resource","Hand over data with resource()",{"id":102,"text":103,"level":88},"answer-requests-with-resolver","Answer requests with resolver()",{"id":105,"text":106,"level":88},"data-urls","data: URLs",{"id":108,"text":109,"level":88},"images","Images",{"id":111,"text":112,"level":88},"stylesheets","Stylesheets",{"id":47,"text":48,"level":88},{"id":115,"text":116,"level":88},"frames-iframe-object-and-embed","Frames: \u003Ciframe>, \u003Cobject> and \u003Cembed>",{"id":118,"text":119,"level":88},"what-is-never-loaded","What is never loaded",{"id":121,"text":122,"level":88},"diagnostics-for-missing-resources","Diagnostics for missing resources",{"id":124,"text":125,"level":88},"laravel-assets-and-vite","Laravel: assets and Vite","https:\u002F\u002Fgithub.com\u002Fnforst\u002Ffagus\u002Fedit\u002Fmain\u002Fdocs\u002Fresources.md","https:\u002F\u002Fgithub.com\u002Fnforst\u002Ffagus\u002Fblob\u002Fv0.1.0\u002Fdocs\u002Fresources.md","\u002Fdocs\u002Fresources.md",{"slug":28,"title":29},{"slug":34,"title":35}]