Unchained.Pdf.Rendering 0.1.0-rc.4

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

Unchained.Pdf.Rendering

PDF page rasterization for .NET — render any PDF page to a PNG image with hardware-accurate font shaping. Supports all platforms out of the box.

Targets: net8.0 · net9.0 · net10.0
License: MIT


Installation

<PackageReference Include="Unchained.Pdf.Rendering" Version="0.1.0" />

This single package reference pulls everything needed:

  • Unchained.Pdf — the core PDF engine
  • FreeTypeSharp — FreeType2 bindings + native binaries (Windows, macOS, linux-x64)
  • Unchained.Drawing.Runtimes — the FreeType2 binary for linux-arm64 (the one platform FreeTypeSharp omits)
  • HarfBuzzSharp — text shaping native assets for your platform

No additional setup required on any supported platform.


Usage

using Unchained.Pdf.Engine;
using Unchained.Pdf.Rendering.Engine;

var processor = new DocumentProcessor();
var renderer  = new PdfRenderer();

await using var doc = await processor.LoadAsync("document.pdf");

// Render a single page
byte[] png = await renderer.RenderPageAsync(doc.Pages[1], new RenderOptions(Dpi: 150));
await File.WriteAllBytesAsync("page1.png", png);

// Render all pages
IReadOnlyList<byte[]> pages = await renderer.RenderDocumentAsync(doc, new RenderOptions(Dpi: 72));
for (int i = 0; i < pages.Count; i++)
    await File.WriteAllBytesAsync($"page{i + 1}.png", pages[i]);

// With cancellation
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
var pagesWithCancel = await renderer.RenderDocumentAsync(doc, new RenderOptions(), cts.Token);

RenderOptions

// 72 DPI — screen preview quality
new RenderOptions(Dpi: 72)

// 150 DPI — general purpose
new RenderOptions(Dpi: 150)

// 300 DPI — print quality
new RenderOptions(Dpi: 300)

Check FreeType availability

if (!PdfRenderer.FreeTypeAvailable)
{
    Console.WriteLine("FreeType2 native library not found — rendering skipped.");
    return;
}

Rendering capabilities

Feature Support
Text rendering ✅ Embedded PDF fonts; Standard 14 substitutes (DejaVu); NotoSans Unicode fallback
Text shaping ✅ HarfBuzz GSUB/GPOS — ligatures, RTL (Arabic, Hebrew), Devanagari, CJK
Vector graphics ✅ Paths, rectangles, Bézier curves, fill + stroke
Raster images ✅ DeviceRGB image XObjects (all 9 stream filters supported)
Color spaces ✅ RGB, grayscale, CMYK (approximate)
CTM transforms ✅ Full 2D matrix transforms on all content
Output format PNG (pure managed encoder, no external deps)

Platform support

The native FreeType2 binary is automatically selected and deployed for your platform:

Platform RID
Windows x64 win-x64
Windows arm64 win-arm64
Linux x64 linux-x64
Linux arm64 linux-arm64
macOS x64 (Intel) osx-x64
macOS arm64 (Apple Silicon) osx-arm64

Bundled fonts

Standard 14 PDF fonts are substituted with embedded open-licensed typefaces:

Standard 14 font Substitute License
Helvetica (all variants) DejaVu Sans Bitstream Vera Fonts Copyright
Times (all variants) DejaVu Serif Bitstream Vera Fonts Copyright
Courier (all variants) DejaVu Sans Mono Bitstream Vera Fonts Copyright
Any unrecognised font NotoSans-Regular SIL OFL

Embedded PDF fonts (Type1, TrueType, CFF) are loaded and rendered directly with full fidelity.


License

MIT. All bundled components (FreeType2 FTL, HarfBuzz MIT, DejaVu/NotoSans SIL OFL) are permissive-licensed and safe for commercial use.

GitHub · Report an issue

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 is compatible.  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.1.0-rc.4 38 6/20/2026