OpenPdf 1.6.2

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

OpenPdf

A pure C# PDF library with zero external dependencies. Read, write, and edit PDF files.

Features

Category Capabilities
Read Parse PDF 1.0-1.7, xref streams (PDF 1.5+), object streams, tolerant/repair mode
Write Generate PDF 1.7, FlateDecode compression, incremental updates, linearized PDF
Text Type1 (standard 14), TrueType/CJK (Japanese/Chinese/Korean) with font subsetting
Graphics Lines, rectangles, curves, colors (RGB/CMYK), transparency, clipping
Images JPEG, PNG (RGB/RGBA), BMP (24/32-bit)
Layout Text wrapping, tables, bullet/numbered lists, headers/footers, page numbers
Annotations Links, text notes, highlights
Bookmarks Nested outline/bookmark tree
Forms Read/write AcroForm text fields and checkboxes
Barcode Code128B barcode, QR code (vector rendering)
Security RC4/AES-128 encryption/decryption, password authentication
PDF/A PDF/A-1b compliant generation and validation
Edit Page add/delete/reorder, merge, split, page stamping
Metadata XMP metadata, document info dictionary
Color DeviceRGB/Gray/CMYK, CalGray/RGB, ICCBased, Separation, DeviceN

Quick Start

Generate a PDF

using OpenPdf.Document;

using var doc = PdfDocument.Create("output.pdf");
var page = doc.AddPage();
var font = page.AddFont("Helvetica");
page.DrawText(font, 24, 72, 700, "Hello, World!");
doc.Save();

Japanese Text (CJK)

using OpenPdf.Document;
using OpenPdf.Fonts;

using var doc = PdfDocument.Create("japanese.pdf");
var page = doc.AddPage(595, 842); // A4
var ttf = TrueTypeFont.Load(@"C:\Windows\Fonts\meiryo.ttc", 0);
var font = page.AddTrueTypeFont(ttf);
page.DrawText(font, 24, 72, 770, "こんにちは世界!");
doc.Save();

Read a PDF

using OpenPdf.Document;

using var reader = PdfReader.Open("input.pdf");
Console.WriteLine($"Pages: {reader.PageCount}");
Console.WriteLine($"Version: {reader.Version}");

var extractor = new TextExtractor(reader);
Console.WriteLine(extractor.ExtractAllText());

Merge PDFs

using OpenPdf.Document;

PdfMerger.Merge(
    new[] { "file1.pdf", "file2.pdf", "file3.pdf" },
    "merged.pdf"
);

Table

var table = new TableBuilder(page, font, 10,
    new[] { 100.0, 150.0, 100.0 });
table.AddHeaderRow("Name", "Value", "Unit");
table.AddRow("Width", "210", "mm");
table.AddRow("Height", "297", "mm");
table.Draw(72, 700);

QR Code

using OpenPdf.Barcode;

QrCodeEncoder.DrawQrCode(page, "https://example.com", 72, 600, moduleSize: 4);

PDF/A-1b

using var doc = PdfADocument.Create("archive.pdf");
var page = doc.AddPage();
var font = page.AddFont("Helvetica");
page.DrawText(font, 12, 72, 770, "Long-term archival document");
doc.SetInfo("Title", "Author");
doc.Save();

Installation

dotnet add package OpenPdf

Requirements

  • .NET 10.0 or .NET Standard 2.0

License

MIT

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 was computed.  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 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. 
.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 was computed.  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.
  • .NETStandard 2.0

  • net10.0

    • No dependencies.

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
1.6.2 62 5/25/2026
1.6.1 60 5/23/2026
1.6.0 64 5/8/2026
1.5.0 62 5/1/2026
1.4.0 92 4/11/2026
1.3.3 68 4/8/2026
1.3.2 62 4/8/2026
1.3.1 62 4/8/2026
1.3.0 61 4/8/2026
1.2.0 75 4/5/2026
1.1.1 83 4/2/2026