Imprintor (imprintor v0.1.2)

Imprintor is a library for generating PDF documents from Typst templates.

It provides functions to compile Typst templates with data interpolation and generate PDF documents using a native Rust implementation.

Summary

Functions

Compiles a Typst template to a PDF document.

Functions

compile_to_pdf(config)

Compiles a Typst template to a PDF document.

Takes an Imprintor.Config struct containing the template configuration and returns a binary containing the compiled PDF data.

Parameters

  • config - An %Imprintor.Config{} struct containing:
    • Template source or file path
    • Data for interpolation
    • Compilation options

Returns

  • {:ok, pdf_binary} - Successfully compiled PDF as binary data
  • {:error, reason} - Compilation failed with error reason

typst_to_pdf(config)