[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"docs:adr\u002F0007-layers-for-screen-and-print":3},{"versions":4,"version":29,"nav":32,"path":121,"page":129},[5,10,13,17,20,23,26],{"name":6,"label":7,"prefix":8,"channel":9},"1.3","1.3.0 (latest)","","latest",{"name":11,"label":12,"prefix":11,"channel":11},"next","next (main)",{"name":14,"label":15,"prefix":14,"channel":16},"1.2","1.2.1","old",{"name":18,"label":19,"prefix":18,"channel":16},"1.1","1.1.1",{"name":21,"label":22,"prefix":21,"channel":16},"1.0","1.0.0",{"name":24,"label":25,"prefix":24,"channel":16},"0.2","0.2.0",{"name":27,"label":28,"prefix":27,"channel":16},"0.1","0.1.0",{"name":6,"label":7,"prefix":8,"channel":9,"base":30,"ref":31},"\u002Fdocs","v1.3.0",[33,37,40,43,46,49,52,55,58,61,64,68,71,74,77,80,83,86,89,93,96,99,102,105,108,111,114,117,120,123,126],{"slug":34,"title":35,"group":36},"index","Overview","Guide",{"slug":38,"title":39,"group":36},"getting-started","Getting started",{"slug":41,"title":42,"group":36},"php","PHP API",{"slug":44,"title":45,"group":36},"laravel","Laravel",{"slug":47,"title":48,"group":36},"resources","Resources",{"slug":50,"title":51,"group":36},"deployment","Deployment",{"slug":53,"title":54,"group":36},"troubleshooting","Troubleshooting",{"slug":56,"title":57,"group":36},"from-wkhtmltopdf","Coming from wkhtmltopdf",{"slug":59,"title":60,"group":36},"stability","Stability and upgrades",{"slug":62,"title":63,"group":36},"ai-assistants","Docs for AI assistants",{"slug":65,"title":66,"group":67},"css","CSS reference","Reference",{"slug":69,"title":70,"group":67},"paged-media","Paged media",{"slug":72,"title":73,"group":67},"fonts","Fonts",{"slug":75,"title":76,"group":67},"extensions","Extensions",{"slug":78,"title":79,"group":67},"compatibility","Compatibility",{"slug":81,"title":82,"group":67},"pdf","The PDF",{"slug":84,"title":85,"group":67},"cli","Command line",{"slug":87,"title":88,"group":67},"rust","Rust library",{"slug":90,"title":91,"group":92},"ffi","C library (experimental)","Internals",{"slug":94,"title":95,"group":92},"protocol","Worker protocol",{"slug":97,"title":98,"group":92},"releasing","Releasing",{"slug":100,"title":101,"group":92},"adr","Architecture decisions",{"slug":103,"title":104,"group":92,"parent":101},"adr\u002F0001-record-architecture-decisions","1. Record architecture decisions",{"slug":106,"title":107,"group":92,"parent":101},"adr\u002F0002-rust-and-fragmentation-in-layout","2. Rust core with fragmentation inside layout",{"slug":109,"title":110,"group":92,"parent":101},"adr\u002F0003-css-parsing-and-own-selector-matching","3. lightningcss for parsing, own selector matching and cascade",{"slug":112,"title":113,"group":92,"parent":101},"adr\u002F0004-extensions-only-where-css-has-no-way","4. Extensions only where CSS has no way",{"slug":115,"title":116,"group":92,"parent":101},"adr\u002F0005-public-api-and-deprecations","5. Public API, semantic versioning and deprecations",{"slug":118,"title":119,"group":92,"parent":101},"adr\u002F0006-pages-that-grow-with-their-content","6. Pages that grow with their content",{"slug":121,"title":122,"group":92,"parent":101},"adr\u002F0007-layers-for-screen-and-print","7. Layers for screen and print, and form fields as an option",{"slug":124,"title":125,"group":92,"parent":101},"adr\u002F0008-c-library-experimental","8. An experimental C library beside the worker",{"slug":127,"title":128,"group":92,"parent":101},"adr\u002F0009-resources-in-batches","9. Resources in batches, fetching stays with the caller",{"title":122,"seoTitle":130,"seoDescription":131,"html":132,"headings":133,"editUrl":151,"sourceUrl":152,"markdownUrl":153,"prev":154,"next":155},"Architecture decisions: 7. Layers for screen and print, and form fields as an option · Fagus docs","Documents without -fagus-layer and rendered without forms() keep their bytes. -fagus-layer is documented in extensions.md and form fields in pdf.md.","\u003Ch1 id=\"7-layers-for-screen-and-print-and-form-fields-as-an-option\">7. Layers for screen and print, and form fields as an option\u003C\u002Fh1>\n\u003Cul>\n\u003Cli>Status: accepted\u003C\u002Fli>\n\u003Cli>Date: 2026-11-19\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"context\">Context\u003Ca class=\"f-doc-anchor\" href=\"#context\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Two features of PDF have no counterpart in how Chrome prints a page:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>Layers\u003C\u002Fstrong> (optional content groups): content that a reader shows and hides, and content that\nshows on screen only or in print only. Invoices want a note such as &quot;Pay online with the link\nbelow&quot; that a printout leaves out, or a &quot;Copy&quot; stamp that only the printout has.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Interactive forms\u003C\u002Fstrong> (AcroForm): fields that a reader fills in in the PDF viewer. Chrome\nprints form controls as they look, and so does Fagus; existing documents with controls must\nkeep their bytes.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>\u003Ca href=\"\u002Fdocs\u002Fadr\u002F0004-extensions-only-where-css-has-no-way\">ADR 4\u003C\u002Fa> allows an extension only where CSS has no\nway to reach the result.\u003C\u002Fp>\n\u003Ch2 id=\"decision\">Decision\u003Ca class=\"f-doc-anchor\" href=\"#decision\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Ch3 id=\"layers\">Layers\u003Ca class=\"f-doc-anchor\" href=\"#layers\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cul>\n\u003Cli>CSS has no way to put content on a layer. \u003Ccode>@media screen\u003C\u002Fcode> and \u003Ccode>@media print\u003C\u002Fcode> look like one,\nbut they choose the styles of a whole rendering: Fagus renders for print, and rules in\n\u003Ccode>@media screen\u003C\u002Fcode> describe how a browser shows the page, often a different layout (navigation, a\nwider column), not content the PDF should show on a screen. Taking them for layers would change\nthe PDFs of existing documents and could not work where the two media lay out differently.\n\u003Ccode>visibility\u003C\u002Fcode> and \u003Ccode>display\u003C\u002Fcode> hide content for every reader.\u003C\u002Fli>\n\u003Cli>So there is an extension, one property: \u003Ccode>-fagus-layer: none | &lt;string&gt; [ screen | print ]?\u003C\u002Fcode>.\nThe string names the layer; elements with the same name share it. \u003Ccode>screen\u003C\u002Fcode> keeps the layer out\nof print, \u003Ccode>print\u003C\u002Fcode> hides it on screen. One property rather than a name and a second property for\nthe medium, since the medium belongs to the layer, not to each element, and a value that names\nboth is harder to get wrong.\u003C\u002Fli>\n\u003Cli>What the element paints is on the layer, with its descendants, as \u003Ccode>opacity\u003C\u002Fcode> groups them: the\nproperty makes the element a stacking context.\u003C\u002Fli>\n\u003Cli>\u003Ccode>@supports (-fagus-layer: none)\u003C\u002Fcode> is true in Fagus.\u003C\u002Fli>\n\u003Cli>PDF\u002FA-2 to PDF\u002FA-4 and PDF\u002FUA-1 forbid the automatic states that make a layer depend on\nprinting (the \u003Ccode>AS\u003C\u002Fcode> entry of an optional content configuration). There the layers stay and show\nin both media, with a warning. PDF\u002FA-1 (PDF 1.4) has no optional content: the content is\nprinted without layers, with a warning. Rendering does not fail, since the content is all\nthere.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3 id=\"form-fields\">Form fields\u003Ca class=\"f-doc-anchor\" href=\"#form-fields\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cul>\n\u003Cli>HTML already says what a field is: \u003Ccode>&lt;input&gt;\u003C\u002Fcode>, \u003Ccode>&lt;textarea&gt;\u003C\u002Fcode>, \u003Ccode>&lt;select&gt;\u003C\u002Fcode>, with \u003Ccode>name\u003C\u002Fcode>, \u003Ccode>value\u003C\u002Fcode>,\n\u003Ccode>checked\u003C\u002Fcode>, \u003Ccode>selected\u003C\u002Fcode>, \u003Ccode>readonly\u003C\u002Fcode>, \u003Ccode>disabled\u003C\u002Fcode>, \u003Ccode>required\u003C\u002Fcode> and \u003Ccode>maxlength\u003C\u002Fcode>. No extension is\nneeded for what a field is.\u003C\u002Fli>\n\u003Cli>Whether controls become fields is an option of the document, off by default: \u003Ccode>forms()\u003C\u002Fcode> in PHP\nand Laravel, \u003Ccode>Document::forms\u003C\u002Fcode> in Rust, \u003Ccode>--forms\u003C\u002Fcode> on the command line, \u003Ccode>forms\u003C\u002Fcode> in the worker\nprotocol. It is not a property, because the choice belongs to the PDF as a whole (a form to\nfill in, or a printout of a filled-in form), not to the style of an element, and because CSS\nhas no property for interactivity that a printout could honour.\u003C\u002Fli>\n\u003Cli>Where one control in a form should stay as it looks (a sample filled in for illustration), HTML\nhas a way: a control in an \u003Ccode>inert\u003C\u002Fcode> element cannot be interacted with, so it stays as printed.\nNo extension is needed for that either.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"consequences\">Consequences\u003Ca class=\"f-doc-anchor\" href=\"#consequences\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Documents without \u003Ccode>-fagus-layer\u003C\u002Fcode> and rendered without \u003Ccode>forms()\u003C\u002Fcode> keep their bytes. \u003Ccode>-fagus-layer\u003C\u002Fcode>\nis documented in \u003Ca href=\"\u002Fdocs\u002Fextensions\">extensions.md\u003C\u002Fa> and form fields in \u003Ca href=\"\u002Fdocs\u002Fpdf\">pdf.md\u003C\u002Fa>. If CSS\ngets a way to place content on layers, \u003Ccode>-fagus-layer\u003C\u002Fcode> is deprecated in its favour, as\n\u003Ca href=\"\u002Fdocs\u002Fadr\u002F0005-public-api-and-deprecations\">ADR 5\u003C\u002Fa> describes.\u003C\u002Fp>\n",[134,138,141,145,148],{"id":135,"text":136,"level":137},"context","Context",2,{"id":139,"text":140,"level":137},"decision","Decision",{"id":142,"text":143,"level":144},"layers","Layers",3,{"id":146,"text":147,"level":144},"form-fields","Form fields",{"id":149,"text":150,"level":137},"consequences","Consequences","https:\u002F\u002Fgithub.com\u002Fnforst\u002Ffagus\u002Fedit\u002Fmain\u002Fdocs\u002Fadr\u002F0007-layers-for-screen-and-print.md","https:\u002F\u002Fgithub.com\u002Fnforst\u002Ffagus\u002Fblob\u002Fv1.3.0\u002Fdocs\u002Fadr\u002F0007-layers-for-screen-and-print.md","\u002Fdocs\u002Fadr\u002F0007-layers-for-screen-and-print.md",{"slug":118,"title":119},{"slug":124,"title":125}]