TypstInterop 2.2.0

dotnet add package TypstInterop --version 2.2.0
                    
NuGet\Install-Package TypstInterop -Version 2.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="TypstInterop" Version="2.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TypstInterop" Version="2.2.0" />
                    
Directory.Packages.props
<PackageReference Include="TypstInterop" />
                    
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 TypstInterop --version 2.2.0
                    
#r "nuget: TypstInterop, 2.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 TypstInterop@2.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=TypstInterop&version=2.2.0
                    
Install as a Cake Addin
#tool nuget:?package=TypstInterop&version=2.2.0
                    
Install as a Cake Tool

TypstInterop

NuGet Typst Build and Pack License: MIT

TypstInterop is a high-performance .NET bridge for Typst, the modern document markup language. It links the Typst compilation engine directly into your process, so you can generate PDFs, images, and HTML from C# without shelling out to a CLI or depending on external services.

It currently embeds Typst 0.15.1 and targets .NET 8, 9, 10, 11 and .NET Framework 4.8, on Windows, Linux (glibc and musl/Alpine), and macOS (x64/arm64; .NET Framework is Windows-only).

Features

  • In-memory compilation to PDF, PNG, SVG, or HTML.
  • Fluent API for sources, assets, fonts, inputs, and mocked packages.
  • PDF options (PDF/A, metadata, reproducible timestamps) and structured diagnostics.
  • Deterministic and offline-capable — control or disable package/font resolution.

Installation

dotnet add package TypstInterop

Runtime identifier

The native Typst engine ships in per-platform TypstInterop.runtime.<rid> packages that the main package selects through a runtime.json RID graph. NuGet only restores those for a specific runtime identifier, so a consuming application must set one — otherwise the native is never restored and the app throws DllNotFoundException: typst_interop at startup.

<PropertyGroup>
  
  <RuntimeIdentifier>linux-x64</RuntimeIdentifier>
</PropertyGroup>
dotnet run     -r linux-x64
dotnet publish -r linux-x64

Supported RIDs: win-x64, win-arm64, linux-x64, linux-arm64, linux-musl-x64, linux-musl-arm64, osx-x64, osx-arm64. Building an executable without a RID emits build warning TYPST0001. Class libraries don't need a RID — the final application picks it. See Getting Started for details.

Quick Start

using TypstInterop;

// The compiler is disposable and owns the native Typst engine life-cycle.
using var compiler = new TypstCompiler();

var result = compiler.Compile(c => c
    .WithSource("= Hello #sys.inputs.user!")
    .WithInput("user", "Developer"));

if (result.IsSuccess)
    File.WriteAllBytes("report.pdf", result.Output.ToArray());
else
    Console.WriteLine($"Compilation failed: {result.ErrorMessage}");

Documentation

Full guides live in the wiki/ folder:

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
2.2.0 153 11/12/2026
2.1.0 2,698 8/1/2026
2.0.2 576 6/23/2026
2.0.1 130 6/22/2026
2.0.0 134 6/22/2026
1.1.1 139 6/16/2026
1.1.0 142 6/16/2026
1.0.1 149 3/31/2026
1.0.0 169 3/31/2026