Documentation

PDF

PDF files focus on accurately describing documents visually, but also have facilities for annotating their structure. This hybrid approach makes them a good fit for document exchange: They render exactly the same on every device, but also support extraction of a document's content and structure (at least to an extent). Unlike PNG files, PDFs are not bound to a specific resolution. Hence, you can view them at any size without incurring a loss of quality.

PDF standards

The International Standards Organization (ISO) has published the base PDF standard and various standards that extend it to make PDFs more suitable for specific use-cases. By default, Typst exports PDF 1.7 files. Adobe Acrobat 8 and later as well as all other commonly used PDF viewers are compatible with this PDF version.

PDF/A

Typst optionally supports emitting PDF/A-conformant files. PDF/A files are geared towards maximum compatibility with current and future PDF tooling. They do not rely on difficult-to-implement or proprietary features and contain exhaustive metadata. This makes them suitable for long-term archival.

The PDF/A Standard has multiple versions (parts in ISO terminology) and most parts have multiple profiles that indicate the file's conformance level. Currently, Typst supports these PDF/A output profiles:

When choosing between exporting PDF/A and regular PDF, keep in mind that PDF/A files contain additional metadata, and that some readers will prevent the user from modifying a PDF/A file. Some features of Typst may be disabled depending on the PDF standard you choose.

Exporting as PDF

Command Line

PDF is Typst's default export format. Running the compile or watch subcommand without specifying a format will create a PDF. When exporting to PDF, you have the following configuration options:

Web App

Click the quick download button at the top right to export a PDF with default settings. For further configuration, click "File" > "Export as" > "PDF" or click the downwards-facing arrow next to the quick download button and select "Export as PDF". When exporting to PDF, you have the following configuration options:

PDF-specific functionality

Typst exposes PDF-specific functionality in the global pdf module. See below for the definitions it contains.

Definitions