{"route":"/en-US-v0.13.1/reference/pdf/","title":"PDF","description":"Documentation for functions related to PDF in Typst.","part":"Export","outline":[{"id":"summary","name":"Summary","children":[]},{"id":"pdf-standards","name":"PDF standards","children":[{"id":"pdf-a","name":"PDF/A","children":[]}]},{"id":"exporting-as-pdf","name":"Exporting as PDF","children":[{"id":"command-line","name":"Command Line","children":[]},{"id":"web-app","name":"Web App","children":[]}]},{"id":"pdf-specific-functionality","name":"PDF-specific functionality","children":[]},{"id":"definitions","name":"Definitions","children":[]}],"body":{"kind":"category","content":{"name":"pdf","title":"PDF","details":"<p>PDF files focus on accurately describing documents visually, but also have\nfacilities for annotating their structure. This hybrid approach makes\nthem a good fit for document exchange: They render exactly the same on every\ndevice, but also support extraction of a document's content and structure (at\nleast to an extent). Unlike PNG files, PDFs are not bound to a specific\nresolution. Hence, you can view them at any size without incurring a loss of\nquality.</p>\n<h2 id=\"pdf-standards\">PDF standards</h2>\n<p>The International Standards Organization (ISO) has published the base PDF\nstandard and various standards that extend it to make PDFs more suitable for\nspecific use-cases. By default, Typst exports PDF 1.7 files. Adobe Acrobat 8 and\nlater as well as all other commonly used PDF viewers are compatible with this\nPDF version.</p>\n<h3 id=\"pdf-a\">PDF/A</h3>\n<p>Typst optionally supports emitting PDF/A-conformant files. PDF/A files are\ngeared towards maximum compatibility with current and future PDF tooling. They\ndo not rely on difficult-to-implement or proprietary features and contain\nexhaustive metadata. This makes them suitable for long-term archival.</p>\n<p>The PDF/A Standard has multiple versions (<em>parts</em> in ISO terminology) and most\nparts have multiple profiles that indicate the file's conformance level.\nCurrently, Typst supports these PDF/A output profiles:</p>\n<ul>\n<li>\n<p>PDF/A-2b: The basic conformance level of ISO 19005-2. This version of PDF/A is\nbased on PDF 1.7 and results in self-contained, archivable PDF files.</p>\n</li>\n<li>\n<p>PDF/A-3b: The basic conformance level of ISO 19005-3. This version of PDF/A is\nbased on PDF 1.7 and results in archivable PDF files that can contain\narbitrary other related files as <a href=\"/en-US-v0.13.1/reference/pdf/embed/\">attachments</a>. The only\ndifference between it and PDF/A-2b is the capability to embed\nnon-PDF/A-conformant files within.</p>\n</li>\n</ul>\n<p>When choosing between exporting PDF/A and regular PDF, keep in mind that PDF/A\nfiles contain additional metadata, and that some readers will prevent the user\nfrom modifying a PDF/A file. Some features of Typst may be disabled depending on\nthe PDF standard you choose.</p>\n<h2 id=\"exporting-as-pdf\">Exporting as PDF</h2>\n<h3 id=\"command-line\">Command Line</h3>\n<p>PDF is Typst's default export format. Running the <code>compile</code> or <code>watch</code>\nsubcommand without specifying a format will create a PDF. When exporting to PDF,\nyou have the following configuration options:</p>\n<ul>\n<li>\n<p>Which PDF standards Typst should enforce conformance with by specifying\n<code>--pdf-standard</code> followed by one or multiple comma-separated standards. Valid\nstandards are <code>1.7</code>, <code>a-2b</code>, and <code>a-3b</code>. By default, Typst outputs\nPDF-1.7-compliant files.</p>\n</li>\n<li>\n<p>Which pages to export by specifying <code>--pages</code> followed by a comma-separated\nlist of numbers or dash-separated number ranges. Ranges can be half-open.\nExample: <code>2,3,7-9,11-</code>.</p>\n</li>\n</ul>\n<h3 id=\"web-app\">Web App</h3>\n<p>Click the quick download button at the top right to export a PDF with default\nsettings. For further configuration, click &quot;File&quot; &gt; &quot;Export as&quot; &gt; &quot;PDF&quot; or click\nthe downwards-facing arrow next to the quick download button and select &quot;Export\nas PDF&quot;. When exporting to PDF, you have the following configuration options:</p>\n<ul>\n<li>\n<p>Which PDF standards Typst should enforce conformance with. By default, Typst\noutputs PDF-1.7-compliant files. Valid additional standards are <code>A-2b</code> and\n<code>A-3b</code>.</p>\n</li>\n<li>\n<p>Which pages to export. Valid options are &quot;All pages&quot;, &quot;Current page&quot;, and\n&quot;Custom ranges&quot;. Custom ranges are a comma-separated list of numbers or\ndash-separated number ranges. Ranges can be half-open. Example: <code>2,3,7-9,11-</code>.</p>\n</li>\n</ul>\n<h2 id=\"pdf-specific-functionality\">PDF-specific functionality</h2>\n<p>Typst exposes PDF-specific functionality in the global <code>pdf</code> module. See below\nfor the definitions it contains.</p>","items":[{"name":"embed","route":"/en-US-v0.13.1/reference/pdf/embed/","oneliner":"A file that will be embedded into the output PDF.","code":true}],"shorthands":null}}}