Pdfium.Net.SDK 5.1.3
PDFium.NET.SDK
PDFium.NET.SDK is a high-performance, cross-platform C# PDF library designed for modern .NET applications. Fully optimized for Native AOT compilation, it delivers blazing-fast startup times and minimal RAM overhead, making it the perfect solution for cloud microservices, AWS Lambda, and ultra-lightweight Docker containers requiring instant cold starts.
With a single package, you get native execution and zero-configuration cross-platform support across Windows, Linux (including Alpine musl-libc), macOS (Intel & Apple Silicon M1-M4), Android, and iOS with full ARM layouts support.
The future of technology, with total legacy respect: While empowering cloud modernization under Native AOT (.NET 8/9/10), it maintains absolute backward compatibility down to .NET Framework 2.0 to protect your legacy infrastructure investments.
Key Features of Version 5.x
- High-Performance Rendering: Complete support for all PDF rendering capabilities and complex document layouts.
- Document Manipulation: Create PDFs from scratch, merge, split, and extract pages.
- Text & Image Extraction: Fast text search, selection, and structured data extraction.
- UI Components: Built-in PDF Viewer controls for WinForms and WPF applications.
- PDF/A, ZUGFeRD, and Factur-X Ready: Out-of-the-box readiness for long-term archiving standards and modern electronic invoicing formats (ZUGFeRD / Factur-X), combining PDF visual data with structured XML metadata.
- Full Native AOT Compatibility: The internal architecture has been fully refactored to support AOT. This ensures seamless operation when compiling with Ahead-of-Time (AOT) deployment, entirely eliminating runtime JIT compilation issues. Perfect for AWS Lambda, cloud microservices, and lightweight Docker containers requiring instant cold starts.
Satellite Packages
The NuGet package manager automatically identifies your application's target architecture and restores the appropriate dependency:
- Pdfium.Net.SDK.runtime.win: Native binaries for Windows (x86, x64) optimized for desktop applications (WPF, WinForms, WinUI).
- Pdfium.Net.SDK.runtime.linux: Native binaries for Linux servers and standard containers based on x64 and arm64 architectures (Ubuntu, Debian, CentOS).
- Pdfium.Net.SDK.runtime.linux-musl: Specialized build targeting ultra-lightweight Alpine Linux containers (musl-libc).
- Pdfium.Net.SDK.runtime.osx: Support for macOS environments (compatible with both Intel and Apple Silicon M1/M2/M3/M4 chips).
- Pdfium.Net.SDK.runtime.android: Mobile native libraries compiling for armeabi-v7a, arm64-v8a, and x86_64 architectures.
Note: You only need to install the main Pdfium.Net.SDK package. Satellite runtime packages are automatically restored as transitive dependencies based on your active deployment target.
Quick Start
Before calling any method of the SDK, you must initialize the library once during your application startup.
using Patagames.Pdf.Net;
// Initialize the C# PDF Library
PdfCommon.Initialize();
1. Render PDF Page to an Image
Easily convert any PDF page into a standard image object (e.g., for generation of thumbnails or visual rendering):
using Patagames.Pdf.Net;
using System.Drawing;
using System.Drawing.Imaging;
// Initialize SDK first
PdfCommon.Initialize();
using (var doc = PdfDocument.Load("sample.pdf"))
{
// Access the first page (0-indexed)
using (var page = doc.Pages[0])
{
// Render page to a System.Drawing.Bitmap at 300 DPI
int width = (int)(page.Width / 72.0 * 300);
int height = (int)(page.Height / 72.0 * 300);
using (var bitmap = new PdfBitmap(width, height, true))
{
bitmap.FillRect(0, 0, width, height, FS_COLOR.White);
page.Render(bitmap, 0, 0, width, height, PageRotate.Normal, RenderFlags.FPDF_LCD_TEXT);
bitmap.Image.Save($"image.png", ImageFormat.Png);
}
}
}
2. Extract Text from PDF Documents
Extract clean, structured text and process layouts from any PDF file in just a few lines of code:
using Patagames.Pdf.Net;
using System;
PdfCommon.Initialize();
using (var doc = PdfDocument.Load("invoice.pdf"))
{
foreach (var page in doc.Pages)
{
// Extract all plain text from the current page
int totalCharCount = page.Text.CountChars;
//Extract text from page to the string
string text = page.Text.GetText(0, totalCharCount);
Console.WriteLine(text);
}
}
3. Merge or Import Pages Between PDFs
Select specific pages from existing files and dynamically merge them into a single PDF document:
using Patagames.Pdf.Net;
PdfCommon.Initialize();
using (var sourceDoc = PdfDocument.Load("source.pdf"))
using (var targetDoc = PdfDocument.CreateNew()) // Create a blank PDF from scratch
{
// Import the first 3 pages from the source document into the new target document
// Parameters: source document, page indexes string (e.g., "0-2"), target insertion index
targetDoc.Pages.ImportPages(sourceDoc, "0-2", 0);
targetDoc.Save("merged_output.pdf", SaveFlags.NoIncremental);
}
.NET Framework vs .NET Modern (Core) Compatibility Guardrails
To prevent compilation errors, ensure you follow the correct API patterns based on your target framework and operating system:
| Feature / Platform | Modern .NET (8 / 9 / 10) | Legacy .NET Framework (2.0 - 4.8) |
|---|---|---|
| Compilation Mode | Supports Native AOT & JIT | JIT Only |
| OS Support | Windows, Linux (Glibc/Musl), macOS, Mobile | Windows Only |
| Image Handling | Use pure PdfBitmap for cross-platform |
Supports standard GDI/Windows Graphics |
Windows GDI API (.Image) |
Supported on Windows only via included Patagames.Pdf.Gdi.dll extension |
Included natively in the core lifecycle |
| Deployment | Runtimes are restored transitively | Requires native ptgpdfcore.dll in the app bin folder |
Important for Developers (API Architecture Rules):
- Windows GDI Dependency (
PdfBitmap.Image): The propertyPdfBitmap.Imagerelies on Windows-specific GDI features. In modern .NET cross-platform environments, this GDI-dependent API is located in the companion assemblyPatagames.Pdf.Gdi.dll, which is already included in the main package. - Cross-Platform / Linux Containers: If you are deploying to Linux Docker, Alpine, or AWS Lambda, do not use
PdfBitmap.Imageor references fromPatagames.Pdf.Gdi.dll. These are Windows-only extensions and will fail on non-Windows platforms. Instead, use pure, cross-platformPdfBitmapmethods for saving images or pixel manipulation. - Using GDI on Windows: If you are building a modern .NET application specifically for Windows (e.g., WPF, WinForms) and need GDI features like
System.Drawing.Image, you can safely use thePdfBitmap.Imageproperty out of the box, as the required GDI extension assembly is pre-bundled. - Targeting Native AOT: The core library architecture is fully pre-compiled and optimized. Do not use runtime reflection when working with the SDK to maintain full Ahead-of-Time deployment compatibility.
Documentation
For complete API references, initialization guides, and step-by-step tutorials, please visit our official documentation:
No packages depend on Pdfium.Net.SDK.
.NET Framework 2.0
- PtgPdfCore.runtime.win (>= 5.0.6)
- icudt.runtime.win (>= 1.0.1)
.NET 7.0
- PtgPdfCore.runtime.win (>= 5.0.6)
- icudt.runtime.win (>= 1.0.1)
.NET 6.0
- icudt.runtime.win (>= 1.0.1)
- PtgPdfCore.runtime.win (>= 5.0.6)
.NET 5.0
- icudt.runtime.win (>= 1.0.1)
- PtgPdfCore.runtime.win (>= 5.0.6)
.NET 10.0
- PtgPdfCore.runtime.linux-musl (>= 5.0.6)
- PtgPdfCore.runtime.linux (>= 5.0.6)
- PtgPdfCore.runtime.win (>= 5.0.6)
- icudt.runtime.win (>= 1.0.1)
- PtgPdfCore.runtime.osx (>= 5.0.6)
.NET 9.0
- PtgPdfCore.runtime.linux-musl (>= 5.0.6)
- PtgPdfCore.runtime.linux (>= 5.0.6)
- PtgPdfCore.runtime.osx (>= 5.0.6)
- icudt.runtime.win (>= 1.0.1)
- PtgPdfCore.runtime.win (>= 5.0.6)
.NET 8.0
- PtgPdfCore.runtime.win (>= 5.0.6)
- icudt.runtime.win (>= 1.0.1)
.NET 9.0
- PtgPdfCore.runtime.win (>= 5.0.6)
- icudt.runtime.win (>= 1.0.1)
.NET 10.0
- PtgPdfCore.runtime.osx (>= 5.0.6)
.NET 9.0
- PtgPdfCore.runtime.osx (>= 5.0.6)
.NET 8.0
- PtgPdfCore.runtime.osx (>= 5.0.6)
.NET 7.0
- PtgPdfCore.runtime.osx (>= 5.0.6)
.NET 6.0
- PtgPdfCore.runtime.osx (>= 5.0.6)
.NET 5.0
- PtgPdfCore.runtime.osx (>= 5.0.6)
.NET 10.0
- PtgPdfCore.runtime.android (>= 5.0.6)
.NET 9.0
- PtgPdfCore.runtime.android (>= 5.0.6)
.NET 8.0
- PtgPdfCore.runtime.android (>= 5.0.6)
.NET 7.0
- PtgPdfCore.runtime.android (>= 5.0.6)
.NET 6.0
- PtgPdfCore.runtime.android (>= 5.0.6)
.NET 5.0
- PtgPdfCore.runtime.android (>= 5.0.6)
.NET 10.0
- icudt.runtime.win (>= 1.0.1)
- PtgPdfCore.runtime.win (>= 5.0.6)
.NET 8.0
- PtgPdfCore.runtime.linux-musl (>= 5.0.6)
- PtgPdfCore.runtime.linux (>= 5.0.6)
- icudt.runtime.win (>= 1.0.1)
- PtgPdfCore.runtime.osx (>= 5.0.6)
- PtgPdfCore.runtime.win (>= 5.0.6)
.NET Standard 2.0
- PtgPdfCore.runtime.osx (>= 5.0.6)
- icudt.runtime.win (>= 1.0.1)
- PtgPdfCore.runtime.win (>= 5.0.6)
- PtgPdfCore.runtime.linux (>= 5.0.6)
- PtgPdfCore.runtime.linux-musl (>= 5.0.6)
UAP 10.0
- win2d.uwp (>= 1.27.0)
- icudt.runtime.win (>= 1.0.1)
- PtgPdfCore.runtime.win (>= 5.0.6)
.NET Framework 4.8
- icudt.runtime.win (>= 1.0.1)
- PtgPdfCore.runtime.win (>= 5.0.6)
.NET Framework 4.5
- icudt.runtime.win (>= 1.0.1)
- PtgPdfCore.runtime.win (>= 5.0.6)
.NET Framework 4.0
- icudt.runtime.win (>= 1.0.1)
- PtgPdfCore.runtime.win (>= 5.0.6)
.NET Framework 3.5
- icudt.runtime.win (>= 1.0.1)
- PtgPdfCore.runtime.win (>= 5.0.6)
.NET 5.0
- icudt.runtime.win (>= 1.0.1)
- PtgPdfCore.runtime.win (>= 5.0.6)
- PtgPdfCore.runtime.linux-musl (>= 5.0.6)
- PtgPdfCore.runtime.linux (>= 5.0.6)
- PtgPdfCore.runtime.osx (>= 5.0.6)
.NET 7.0
- PtgPdfCore.runtime.linux-musl (>= 5.0.6)
- PtgPdfCore.runtime.linux (>= 5.0.6)
- icudt.runtime.win (>= 1.0.1)
- PtgPdfCore.runtime.win (>= 5.0.6)
- PtgPdfCore.runtime.osx (>= 5.0.6)
.NET 6.0
- PtgPdfCore.runtime.linux-musl (>= 5.0.6)
- PtgPdfCore.runtime.linux (>= 5.0.6)
- PtgPdfCore.runtime.osx (>= 5.0.6)
- icudt.runtime.win (>= 1.0.1)
- PtgPdfCore.runtime.win (>= 5.0.6)
| Version | Downloads | Last updated |
|---|---|---|
| 5.1.3 | 4 | 09/23/2026 |
| 5.1.2 | 1 | 09/01/2026 |
| 5.0.2 | 3 | 09/01/2026 |
| 5.0.1 | 5 | 09/01/2026 |
| 4.112.2704 | 9 | 05/19/2026 |
| 4.111.2704 | 11 | 05/14/2026 |
| 4.110.2704 | 10 | 05/10/2026 |
| 4.109.2704 | 13 | 04/30/2026 |
| 4.108.2704 | 12 | 04/30/2026 |
| 4.107.2704 | 16 | 03/20/2026 |
| 4.106.2704 | 13 | 03/14/2026 |
| 4.105.2704 | 14 | 02/27/2026 |
| 4.104.2704 | 13 | 02/01/2026 |
| 4.103.2704 | 19 | 09/26/2025 |
| 4.102.2704 | 20 | 09/16/2025 |
| 4.101.2704 | 20 | 08/21/2025 |
| 4.100.2704 | 24 | 07/13/2025 |
| 4.99.2704 | 24 | 06/07/2025 |
| 4.98.2704 | 19 | 06/13/2025 |
| 4.97.2704 | 21 | 06/08/2025 |
| 4.96.2704 | 22 | 06/13/2025 |
| 4.95.2704 | 20 | 06/13/2025 |
| 4.94.2704 | 24 | 06/13/2025 |
| 4.93.2704 | 24 | 06/08/2025 |
| 4.92.2704 | 21 | 06/13/2025 |
| 4.91.2704 | 19 | 06/13/2025 |
| 4.90.2704 | 22 | 06/12/2025 |
| 4.89.2704 | 18 | 06/13/2025 |
| 4.88.2704 | 20 | 06/13/2025 |
| 4.87.2704 | 22 | 06/08/2025 |
| 4.86.2704 | 20 | 06/13/2025 |
| 4.85.2704 | 21 | 06/13/2025 |
| 4.84.2704 | 23 | 06/13/2025 |
| 4.83.2704 | 21 | 06/08/2025 |
| 4.82.2704 | 19 | 06/13/2025 |
| 4.81.2704 | 23 | 06/08/2025 |
| 4.80.2704 | 20 | 06/08/2025 |
| 4.79.2704 | 20 | 06/13/2025 |
| 4.78.2704 | 23 | 06/08/2025 |
| 4.77.2704 | 23 | 06/08/2025 |
| 4.76.2704 | 23 | 06/08/2025 |
| 4.75.2704 | 19 | 06/08/2025 |
| 4.74.2704 | 21 | 06/12/2025 |
| 4.73.2704 | 22 | 06/08/2025 |
| 4.72.2704 | 23 | 06/08/2025 |
| 4.71.2704 | 22 | 06/13/2025 |
| 4.70.2704 | 20 | 06/12/2025 |
| 4.69.2704 | 20 | 06/13/2025 |
| 4.68.2704 | 20 | 06/13/2025 |
| 4.67.2704 | 24 | 06/13/2025 |
| 4.66.2704 | 19 | 06/13/2025 |
| 4.65.2704 | 22 | 06/13/2025 |
| 4.64.2704 | 20 | 06/08/2025 |
| 4.63.2704 | 23 | 06/13/2025 |
| 4.62.2704 | 22 | 06/08/2025 |
| 4.61.2704 | 22 | 06/08/2025 |
| 4.60.2704 | 22 | 06/13/2025 |
| 4.59.2704 | 21 | 06/13/2025 |
| 4.58.2704 | 22 | 06/13/2025 |
| 4.57.2704 | 21 | 06/13/2025 |
| 4.56.2704 | 23 | 06/08/2025 |
| 4.55.2704 | 25 | 06/08/2025 |
| 4.54.2704 | 19 | 06/13/2025 |
| 4.53.2704 | 22 | 06/13/2025 |
| 4.52.2704 | 22 | 06/08/2025 |
| 4.51.2704 | 21 | 06/13/2025 |
| 4.50.2704 | 17 | 06/13/2025 |
| 4.49.2704 | 22 | 06/08/2025 |
| 4.48.2704 | 21 | 06/13/2025 |
| 4.47.2704 | 21 | 06/12/2025 |
| 4.46.2704 | 21 | 06/08/2025 |
| 4.45.2704 | 22 | 06/13/2025 |
| 4.44.2704 | 22 | 06/12/2025 |
| 4.43.2704 | 21 | 06/12/2025 |
| 4.42.2704 | 22 | 06/08/2025 |
| 4.41.2704 | 21 | 06/08/2025 |
| 4.40.2704 | 23 | 06/12/2025 |
| 4.39.2704 | 20 | 06/12/2025 |
| 4.38.2704 | 20 | 06/13/2025 |
| 4.37.2704 | 23 | 06/08/2025 |
| 4.36.2704 | 20 | 06/08/2025 |
| 4.35.2704 | 22 | 06/08/2025 |
| 4.34.2704 | 23 | 06/12/2025 |
| 4.33.2704 | 20 | 06/08/2025 |
| 4.32.2704 | 22 | 06/08/2025 |
| 4.31.2704 | 20 | 06/13/2025 |
| 4.30.2704 | 22 | 06/12/2025 |
| 4.29.2704 | 21 | 06/13/2025 |
| 4.28.2704 | 20 | 06/13/2025 |
| 4.27.2704 | 21 | 06/08/2025 |
| 4.26.2704 | 22 | 06/08/2025 |
| 4.25.2704 | 19 | 06/13/2025 |
| 4.24.2704 | 21 | 06/12/2025 |
| 4.23.2704 | 22 | 06/08/2025 |
| 4.22.2704 | 20 | 06/12/2025 |
| 4.21.2704 | 19 | 06/08/2025 |
| 4.20.2704 | 24 | 06/08/2025 |
| 4.19.2704 | 21 | 06/08/2025 |
| 4.18.2704 | 21 | 06/12/2025 |
| 4.17.2704 | 24 | 06/08/2025 |
| 4.16.2704 | 22 | 06/08/2025 |
| 4.15.2704 | 22 | 06/08/2025 |
| 4.14.2704 | 23 | 06/08/2025 |
| 4.12.2704 | 22 | 06/08/2025 |
| 4.11.2704 | 21 | 06/08/2025 |
| 4.10.2704 | 22 | 06/08/2025 |
| 4.9.2704 | 23 | 06/08/2025 |
| 4.8.2704 | 24 | 06/08/2025 |
| 4.7.2704 | 22 | 06/08/2025 |
| 4.6.2704 | 20 | 06/08/2025 |
| 4.5.2704 | 19 | 06/08/2025 |
| 4.4.2704 | 18 | 06/08/2025 |
| 4.3.2704 | 23 | 06/13/2025 |
| 4.2.2704 | 21 | 06/08/2025 |
| 4.1.2704 | 21 | 06/08/2025 |
| 4.0.2704 | 22 | 06/08/2025 |
| 3.48.2704 | 23 | 06/13/2025 |
| 3.47.2704 | 22 | 06/12/2025 |
| 3.46.2704 | 21 | 06/08/2025 |
| 3.45.2704 | 23 | 06/08/2025 |
| 3.44.2704 | 20 | 06/08/2025 |
| 3.43.2704 | 22 | 06/08/2025 |
| 3.42.2704 | 22 | 06/08/2025 |
| 3.41.2704 | 22 | 06/08/2025 |
| 3.40.2704 | 21 | 06/12/2025 |
| 3.39.2704 | 28 | 06/13/2025 |
| 3.38.2704 | 22 | 06/13/2025 |
| 3.37.2704 | 19 | 06/08/2025 |
| 3.36.2704 | 21 | 06/08/2025 |
| 3.35.2704 | 19 | 06/08/2025 |
| 3.34.2704 | 21 | 06/12/2025 |
| 3.33.2704 | 21 | 06/12/2025 |
| 3.32.2704 | 20 | 06/08/2025 |
| 3.31.2704 | 20 | 06/13/2025 |
| 3.30.2704 | 22 | 06/12/2025 |
| 3.29.2704 | 22 | 06/08/2025 |
| 3.28.2704 | 21 | 06/13/2025 |
| 3.27.2704 | 21 | 06/08/2025 |
| 3.26.2704 | 21 | 06/08/2025 |
| 3.25.2704 | 20 | 06/08/2025 |
| 3.24.2704 | 21 | 06/08/2025 |
| 3.23.2704 | 21 | 06/08/2025 |
| 3.22.2704 | 22 | 06/08/2025 |
| 3.21.2704 | 22 | 06/08/2025 |
| 3.20.2704 | 23 | 06/08/2025 |
| 3.19.2704 | 21 | 06/08/2025 |
| 3.18.2704 | 23 | 06/08/2025 |
| 3.17.2704 | 22 | 06/08/2025 |
| 3.16.2704 | 22 | 06/08/2025 |
| 3.15.2704 | 23 | 06/08/2025 |
| 3.14.2704 | 23 | 06/08/2025 |
| 3.12.5 | 24 | 06/08/2025 |
| 3.12.4 | 24 | 06/08/2025 |
| 3.12.3 | 25 | 06/08/2025 |
| 3.11.3 | 23 | 06/08/2025 |
| 3.11.2 | 24 | 06/08/2025 |
| 3.11.1 | 23 | 06/08/2025 |
| 3.10.6 | 27 | 06/08/2025 |
| 3.10.5 | 26 | 06/13/2025 |
| 3.10.4 | 25 | 06/08/2025 |
| 3.10.3 | 27 | 06/08/2025 |
| 3.10.2 | 25 | 06/08/2025 |
| 3.10.1 | 27 | 06/13/2025 |
| 3.9.5 | 20 | 06/08/2025 |
| 3.9.4 | 23 | 06/08/2025 |
| 3.9.3 | 22 | 06/08/2025 |
| 3.9.2 | 23 | 06/08/2025 |
| 3.9.1 | 23 | 06/08/2025 |
| 3.8.3 | 22 | 06/08/2025 |
| 3.8.2 | 26 | 06/08/2025 |
| 3.8.1 | 24 | 06/08/2025 |
| 3.7.7 | 23 | 06/08/2025 |
| 3.7.6 | 19 | 06/08/2025 |
| 3.7.5 | 23 | 06/08/2025 |
| 3.7.4 | 24 | 06/08/2025 |
| 3.7.3 | 25 | 06/08/2025 |
| 3.7.2 | 23 | 06/08/2025 |
| 3.6.4 | 23 | 06/08/2025 |
| 3.6.3 | 23 | 06/08/2025 |
| 3.6.2 | 23 | 06/08/2025 |
| 3.5.1 | 23 | 06/08/2025 |
| 3.4.1 | 20 | 06/13/2025 |
| 3.3.2 | 22 | 06/08/2025 |
| 3.3.1 | 22 | 06/08/2025 |
| 3.2.3 | 21 | 06/08/2025 |
| 3.2.2 | 23 | 06/08/2025 |
| 3.2.1 | 22 | 06/08/2025 |
| 3.1.1 | 21 | 06/08/2025 |
| 3.0.3 | 24 | 06/08/2025 |
| 3.0.2 | 24 | 06/08/2025 |
| 3.0.1 | 22 | 06/08/2025 |
| 2.18.7 | 24 | 06/08/2025 |
| 2.18.6 | 23 | 06/08/2025 |
| 2.18.5 | 23 | 06/08/2025 |
| 2.18.4 | 23 | 06/08/2025 |
| 2.18.3 | 25 | 06/08/2025 |
| 2.18.2 | 24 | 06/08/2025 |
| 2.18.1 | 22 | 06/08/2025 |
| 2.17.3 | 21 | 06/08/2025 |
| 2.17.2 | 25 | 06/08/2025 |
| 2.17.1 | 23 | 06/08/2025 |
| 2.16.1 | 23 | 06/08/2025 |
| 2.15.12 | 23 | 06/08/2025 |
| 2.15.9 | 24 | 06/13/2025 |
| 2.15.5 | 25 | 06/08/2025 |
| 2.15.4 | 25 | 06/08/2025 |
| 2.15.3 | 25 | 06/08/2025 |
| 2.15.2 | 23 | 06/08/2025 |
| 2.15.1 | 22 | 06/08/2025 |
| 2.14.15 | 20 | 06/13/2025 |
| 2.14.14 | 23 | 06/08/2025 |
| 2.14.12 | 22 | 06/08/2025 |
| 2.14.11 | 21 | 06/13/2025 |
| 2.14.10 | 22 | 06/08/2025 |
| 2.14.9 | 25 | 06/08/2025 |
| 2.14.8 | 23 | 06/08/2025 |
| 2.14.7 | 24 | 06/08/2025 |
| 2.14.6 | 22 | 06/08/2025 |