Typst.Native 0.2.0

dotnet add package Typst.Native --version 0.2.0
                    
NuGet\Install-Package Typst.Native -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Typst.Native" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Typst.Native" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Typst.Native" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Typst.Native --version 0.2.0
                    
#r "nuget: Typst.Native, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Typst.Native@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Typst.Native&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Typst.Native&version=0.2.0
                    
Install as a Cake Tool

Typst.Native

CI Security Audit License: MIT

.NET bindings for Typst, the modern markup-based typesetting system.

Typst.Native lets you compile Typst documents to PDF, SVG, and PNG directly from .NET — no CLI installation or external processes required.

Features

  • Native performance: calls Typst's Rust core via P/Invoke (no WASM overhead)
  • Cross-platform: ships pre-built native libraries for Windows, Linux, and macOS (x64 + ARM64)
  • Zero external dependencies: everything is bundled in the NuGet package
  • Idiomatic C# API: TypstCompiler, diagnostics, streaming output

Quick Start

dotnet add package Typst.Native
using Typst.Native;

using var compiler = new TypstCompiler();

var result = compiler.Compile("Hello, *Typst* from .NET!");

if (result.IsSuccess)
{
    byte[] pdf = result.ToPdf();
    File.WriteAllBytes("output.pdf", pdf);
}
else
{
    foreach (var diag in result.Diagnostics)
        Console.Error.WriteLine(diag);
}

Supported Platforms

Runtime NuGet RID CI Runner
Windows x64 win-x64 windows-latest
Linux x64 linux-x64 ubuntu-latest
Linux ARM64 linux-arm64 ubuntu-24.04-arm
macOS x64 osx-x64 macos-latest (cross-compile)
macOS ARM64 osx-arm64 macos-latest

Building from Source

Prerequisites

Build the native library

cd native/typst-ffi
cargo build --release

The shared library will be output to native/typst-ffi/target/release/.

Build the .NET solution

dotnet build
dotnet test

Note: To run tests locally, you need to first build the native library and place it in the appropriate runtimes/{rid}/native/ directory under src/Typst.Native.Runtime/.

Architecture

Typst.Native/
├── native/typst-ffi/          # Rust FFI crate — thin C API over Typst
├── src/
│   ├── Typst.Native/           # Managed C# wrapper (main NuGet: Typst.Native)
│   ├── Typst.Native.Runtime/   # Native binaries package (Typst.Native.Runtime)
│   └── Typst.Native.Tests/     # Unit & integration tests
└── .github/workflows/         # CI/CD pipelines

Packages

Package Description
Typst.Native Managed wrapper — the package you reference
Typst.Native.Runtime Pre-built native libraries for all platforms

Contributing

Contributions are welcome! Please open an issue first to discuss what you'd like to change.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit your changes
  4. Push to the branch and open a Pull Request

License

This project is licensed under the MIT License.

Typst itself is licensed under the Apache License 2.0. See the Typst repository for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 148 3/17/2026
0.1.1 105 3/10/2026
0.1.0 113 3/10/2026