Unchained.Pdf.Rendering
0.1.0-rc.4
dotnet add package Unchained.Pdf.Rendering --version 0.1.0-rc.4
NuGet\Install-Package Unchained.Pdf.Rendering -Version 0.1.0-rc.4
<PackageReference Include="Unchained.Pdf.Rendering" Version="0.1.0-rc.4" />
<PackageVersion Include="Unchained.Pdf.Rendering" Version="0.1.0-rc.4" />
<PackageReference Include="Unchained.Pdf.Rendering" />
paket add Unchained.Pdf.Rendering --version 0.1.0-rc.4
#r "nuget: Unchained.Pdf.Rendering, 0.1.0-rc.4"
#:package Unchained.Pdf.Rendering@0.1.0-rc.4
#addin nuget:?package=Unchained.Pdf.Rendering&version=0.1.0-rc.4&prerelease
#tool nuget:?package=Unchained.Pdf.Rendering&version=0.1.0-rc.4&prerelease
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 engineFreeTypeSharp— 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.
| Product | Versions 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. |
-
net10.0
- CoreJ2K (>= 2.3.0.81)
- FreeTypeSharp (>= 3.1.0)
- HarfBuzzSharp (>= 8.3.1.5)
- HarfBuzzSharp.NativeAssets.Linux (>= 8.3.1.5)
- HarfBuzzSharp.NativeAssets.macOS (>= 8.3.1.5)
- HarfBuzzSharp.NativeAssets.Win32 (>= 8.3.1.5)
- JBig2Decoder.NETStandard (>= 1.5.2)
- JpegLibrary (>= 0.4.32)
- Markdig (>= 1.3.0)
- System.Security.Cryptography.Pkcs (>= 10.0.9)
- Unchained.Drawing.Text (>= 0.1.0-rc.4)
- Unchained.Pdf (>= 0.1.0-rc.4)
-
net8.0
- CoreJ2K (>= 2.3.0.81)
- FreeTypeSharp (>= 3.1.0)
- HarfBuzzSharp (>= 8.3.1.5)
- HarfBuzzSharp.NativeAssets.Linux (>= 8.3.1.5)
- HarfBuzzSharp.NativeAssets.macOS (>= 8.3.1.5)
- HarfBuzzSharp.NativeAssets.Win32 (>= 8.3.1.5)
- JBig2Decoder.NETStandard (>= 1.5.2)
- JpegLibrary (>= 0.4.32)
- Markdig (>= 1.3.0)
- System.Security.Cryptography.Pkcs (>= 10.0.9)
- Unchained.Drawing.Text (>= 0.1.0-rc.4)
- Unchained.Pdf (>= 0.1.0-rc.4)
-
net9.0
- CoreJ2K (>= 2.3.0.81)
- FreeTypeSharp (>= 3.1.0)
- HarfBuzzSharp (>= 8.3.1.5)
- HarfBuzzSharp.NativeAssets.Linux (>= 8.3.1.5)
- HarfBuzzSharp.NativeAssets.macOS (>= 8.3.1.5)
- HarfBuzzSharp.NativeAssets.Win32 (>= 8.3.1.5)
- JBig2Decoder.NETStandard (>= 1.5.2)
- JpegLibrary (>= 0.4.32)
- Markdig (>= 1.3.0)
- System.Security.Cryptography.Pkcs (>= 10.0.9)
- Unchained.Drawing.Text (>= 0.1.0-rc.4)
- Unchained.Pdf (>= 0.1.0-rc.4)
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 |