Skip to content

PDF Exports

Use this page when you need a PDF rendering of a frozen reporting snapshot.

Who This Is For

  • operators handing reports to finance, support, or compliance reviewers
  • self-hosters configuring PDF rendering dependencies
  • teams that need a printable or shareable report artifact

When To Use This

Use PDF exports when JSON or CSV is not the right delivery format for the audience.

PDF is a render layer on top of a frozen export snapshot. It is not an independent live query path.

How It Works

PDF exports are created through the same export API as other formats:

  • POST /api/v1/reports/exports
  • GET /api/v1/reports/exports/{id}
  • GET /api/v1/reports/exports/{id}/download

Request requirements:

  • report_kind
  • format: "pdf"

Supported PDF report kinds:

  • usage-summary
  • usage-ledger
  • license-audit
  • customer-summary
  • subscription-settlement

For self-hosted rendering, the PDF pipeline uses Typst. The renderer looks for:

  • LOCKSMITH_TYPST_BIN

If the variable is not set, it falls back to typst on PATH.

Example

Create a PDF export:

bash
curl -X POST https://api.licensekit.dev/api/v1/reports/exports \
  -H "Authorization: Bearer $LICENSEKIT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "report_kind": "license-audit",
    "format": "pdf",
    "filters": {
      "license_id": "lic_123"
    }
  }'

Download it:

bash
curl -L https://api.licensekit.dev/api/v1/reports/exports/rptx_123/download \
  -H "Authorization: Bearer $LICENSEKIT_TOKEN"

Common Mistakes

  • treating PDF as the canonical data source instead of a rendered artifact
  • forgetting the self-hosted Typst dependency when enabling PDF rendering
  • assuming all report formats are interchangeable without checking content_type

Prototype docs shell for the rewrite workspace.