Skip to content

Release 0.15.1.1

Latest

Choose a tag to compare

@evolvedlight evolvedlight released this 06 Sep 15:45
f9332a4

Versioning

This library tries to keep in sync with the upstream typst version for simplicity - as this doesn't bump the typst version it's released as 0.15.1.1, rather than 0.15.2

⚠️ Breaking Changes

  • Strict PDF standard validation: Invalid or contradictory combinations of PDF standards (such as specifying two PDF/A levels or requesting a PDF/A profile that contradicts the target PDF version) now fail compilation and throw an exception with diagnostic messages and hints from Typst. Previously, errors from PdfStandards::new were silently ignored, causing pipelines to fall back to producing standard PDFs unannounced.

    Note: Typst's PDF/A and PDF/UA exporters deliberately omit build timestamps. Ensure target documents define their own metadata via #set document(date: ...) (plus title and language for PDF/UA compliance).

  • Streaming CompilePdf overloads return warnings: compiler.CompilePdf(Stream), compiler.CompilePdfAsync(Stream), compiler.CompilePdf(string outputFile), and compiler.CompilePdfAsync(string outputFile) now stream directly from native memory to the destination and return compiler warnings rather than returning an in-memory PdfResult. Use compiler.CompilePdf() when you need the byte buffer materialized directly.

🚀 Added

  • Zero-copy document handling (CompileToDocument): Added compiler.CompileToDocument(...), which returns a disposable TypstDocument exposing rendered output directly from native allocations.
    • Use GetOutputSpan, OpenOutputStream, CopyOutputTo, WriteOutputToFile, or RentOutput to inspect and stream large files without putting multi-megabyte buffers on the Large Object Heap (LOH).
    • Use GetOutputBytes when a managed byte[] allocation is explicitly required.
  • Streamlined compilation APIs:
    • Added compiler.CompilePdf(...) returning a PdfResult with implicit conversions to byte[], ReadOnlySpan<byte>, and ReadOnlyMemory<byte>.
    • Added compiler.CompilePdf(string outputFile) and compiler.CompilePdfAsync(string outputFile) for direct file output.
    • Added compiler.CompilePdf(Stream destination) and compiler.CompilePdfAsync(Stream destination) for stream pipelines.
    • Added static convenience one-liners: TypstCompiler.CompilePdf(...) and TypstCompiler.CompilePdfFromFile(...).
    • Added dedicated format export helpers: compiler.CompileSvg(...) and compiler.CompilePng(...).
    • Added outcome.AsPdf() and outcome.PrimaryBuffer properties to CompileOutcome.
  • Simultaneous multi-standard PDF export: Added support for compiling documents against multiple PDF standards simultaneously (e.g., v-1.7, a-2b) via the pdfStandards parameter in TypstCompiler.Compile, leveraging the updated typst-pdf crate in Typst 0.15.
  • Offline / vendored package control: Added includeSystemPackages to TypstCompiler. Setting this to false enforces strictly local package resolution from packagePath, preventing unexpected downloads from Typst Universe and guaranteeing isolated, offline compilation.

🔄 Changed

  • Reduced managed heap allocations: compiler.Compile(outputFile, format) and compiler.CompileSvg(...) now stream and write data without allocating intermediate copies on the managed heap.

🐛 Fixed

  • Windows subfolder path crash: Fixed an issue where passing a subfolder path with backslashes on Windows (e.g., templates\letter.typ) caused Typst's virtual path parser to panic inside a native call and crash the host process. Input paths are now resolved against the project root prior to virtual path normalization, and paths attempting to escape the root boundary return compilation errors instead of panicking.

    Note: On Windows, the project root is matched textually against absolute input paths; both paths must use matching casing.

  • PDF/UA-1 rejection in pdfStandards: Fixed an issue where ua-1 (PDF/UA-1 accessibility standard) was rejected. Accepted standard names are now sourced directly from typst_pdf::PdfStandard, ensuring immediate compatibility with all current and future standards supported by Typst. The v- prefix convention remains supported solely for standard PDF versions (e.g., v-1.7).

New Contributors

Full Changelog: 0.15.1...0.15.1.1