Skip to content

pdk pdf

pdk pdf builds one PDF from the completed Zensical website and the PDF settings in the project configuration.

Use the PDF generation task guide to prepare renderers, configure the document, and resolve build failures.

Synopsis

Use the complete-document form or select one Markdown page for focused review.

pdk pdf [--config-file PATH] [--markdown-file PAGE]

Working directory

Run this command from the project root, after building the website there. Use --config-file PATH when deliberately building another configuration; --markdown-file remains relative to that configuration's docs_dir.

From the wrong directory it normally reports project configuration not found: .../zensical.toml. If the configuration is found but the website has not been built, expect built site not found: ...; run zensical build first instead.

Options

Table 45.1 lists the PDF source-selection controls.

1. PDF build options

Option Behaviour
-f, --config-file PATH Read another Zensical configuration; defaults to zensical.toml.
-m, --markdown-file PAGE Build only one Markdown page relative to docs_dir, ignoring nav for the PDF contents.
-h, --help Show installed help and exit.

Inputs and output

The command uses the completed site_dir; build the website first with zensical build --clean --strict. It assembles the pages in configured navigation order, processes PDF-only features, then asks Pandoc and WeasyPrint to write the configured PDF path.

The single-page option still reads layout, fonts, styles, and renderer settings from the configuration. It changes only the scope of the PDF contents.

Exit status

A missing or mismatched environment, incomplete built site, invalid PDF configuration, renderer failure, or unwritable output produces a non-zero exit and preserves the underlying tool's useful error detail.

Use these commands to validate inputs or build the companion source artifact:

  • pdk config checks PDF settings and inputs without building.
  • pdk source-bundle renders the underlying source as a separate submission artifact.