Read PDFs at the speed of your disk. Not your patience.
Hypapdf is a fast, dependency-free PDF reader for .NET 8, 9, 10 and 11. It extracts text, words and reading order, form fields, images, bookmarks and links, 5 to 35 times faster than every other open-source .NET option measured, native PDFium and MuPDF included.
Measured against every open-source .NET PDF reader.
Hypapdf is measured against every open-source .NET library that can read PDF text, on the same files, each in its own process. The results below come from the benchmark result files in the repository, with the hardware, versions and commands used.
Real-world documents283 msText of 1,298 pages (31 MiB), one threadAllocated 79.5 MB5.3x faster than PDFium, 7.3x faster than PdfPig, 10.8x faster than iText
All figures come from one Apple M1 Max, natively on macOS and in a Linux container; there is no native x86-64 measurement yet. Docotic.Pdf and IronPDF do not run without a licence key and other commercial libraries were not measured. PDFsharp has no text extraction and is measured for opening only.
Extract text, macOS
8 public documents, 31 MiB, 1,298 pages: the ISO 32000-1 specification, IRS Publication 17 and form 1040, two arXiv papers, Free Culture and two papers from the pdf.js test suite (fetch-corpus.sh)
Apple M1 Max (10 cores), 64 GB, .NET 10 (SDK 11.0.100)
using Hypapdf;using var pdf = await PdfDocument.OpenAsync("report.pdf");Console.WriteLine($"{pdf.PageCount} pages, title: {pdf.Info.Title}");// Multi-column pages in reading order; MaxDegreeOfParallelism = 0 uses every core.string text = pdf.ExtractText(new PdfTextOptions { Layout = PdfTextLayout.ReadingOrder });foreach (var field in pdf.FormFields) Console.WriteLine($"{field.FullName} = {field.Value}");foreach (var item in pdf.Outlines) Console.WriteLine($"{item.Title} -> page {item.PageNumber}");
C1 Features
Built for reading many PDFs, fast and safely.
Fast text extraction
283 ms for 1,298 pages of real-world documents on one thread: 5.3 times faster than PDFium, 7.3 times faster than PdfPig and 10.8 times faster than iText.
Words, lines and reading order
Words, lines and blocks with bounding boxes, font and rotation. Reading order lays out multi-column pages column by column; glyphs come with their positions.
Form fields
AcroForm fields with inherited attributes: text, check boxes, radio groups, combo and list boxes and signatures, with values, options and the page and rectangle of each widget.
Images, bookmarks and links
Images with the rectangle they cover, JPEG and JPEG 2000 bytes as stored and raw images as PNG. The bookmark tree and link annotations with resolved destinations.
4 more featuresFewer features
Safe for untrusted input
Limits on decoded stream size, object count and form nesting. Malformed input surfaces as PdfFormatException, never as a crash or a hang; fuzzing over the pdf.js test suite checks this.
Thread-safe, pages in parallel
Documents, pages and the object model are safe to use from several threads. ExtractText can use every core: 85 ms instead of 283 ms for the same 1,298 pages.
Damaged and encrypted files
Damaged or missing cross-reference data is rebuilt by scanning the file. The standard security handler is supported: RC4, AES-128 and AES-256 with user or owner passwords.
No dependencies
Pure managed .NET for .NET 8, 9, 10 and 11. No native binaries, no other packages; the same package runs on Windows, Linux and macOS.
D1 How it works
Parsed lazily, straight from bytes.
Hypapdf keeps the file in memory and parses it lazily, straight from bytes. Opening a document reads only the cross-reference data; pages, fonts and streams are parsed when you first use them.
PDF bytes ──▶ ▓▓▓ xref ──▶ ▒▒▒ page content (inflated into pooled buffers) ──▶ ░░░ text, words, fields, images
on open on first use, per page, on any thread
01
Lazy, from bytes
No stream abstraction and no tokens as objects. The lexer parses numbers in a single pass, and names are interned per document without locks on lookup.
02
Fonts compiled once
Each font is compiled once per document into code-indexed tables of widths and Unicode strings, so a glyph costs two array reads and text is appended without allocating per glyph.
03
Pooled buffers
Page content is inflated and decrypted into pooled buffers that are released after each page; the text builder is reused per thread. The text run over 1,298 pages allocates 79 MB, against 2.6 GB for PdfPig and 6.9 GB for iText.
04
Pages in parallel
Pages are independent and the document is thread-safe, so ExtractText can spread the pages over every core.
05
Hostile input in mind
Decoded streams, the number of objects and form nesting are limited (256 MiB, 16 million and 32 by default). Errors are PdfFormatException and PdfEncryptedException only.
06
Reads, does not write
Hypapdf does not render, edit or write PDFs and does not run OCR on scanned pages. Text comes in content order, like pdftotext -raw, or in geometric reading order.
A PDF reader for .NET. It opens PDFs, exposes their structure and metadata, decodes streams and extracts text, words and reading order, form fields, images, bookmarks and links, with no runtime dependencies.
Which .NET versions are supported?
.NET 8, 9, 10 and 11, on Windows, Linux and macOS. The package has no other dependencies and no native binaries.
How fast is it?
On 8 real-world documents (31 MiB, 1,298 pages) on an Apple M1 Max, Hypapdf extracts all text in 283 ms on one thread and 85 ms with pages in parallel. PDFium takes 1,503 ms, PdfPig 2,053 ms and iText 3,057 ms. The benchmarks page has the hardware, versions and commands.
Can Hypapdf render, edit or write PDFs?
No. Hypapdf reads PDFs. It does not render pages to images, edit or write PDFs, or run OCR on scanned pages.
Is it safe to open PDFs uploaded by users?
That is what it is built for. Decoded stream size, object count and form nesting are limited, and malformed input is meant to surface only as PdfFormatException or PdfEncryptedException, never as a crash or a hang. Mutation fuzzing over the pdf.js test suite checks this.
Does it read encrypted PDFs?
Yes, with the standard security handler: RC4 (40 to 128 bit), AES-128 and AES-256, with the empty password or a user or owner password. Public-key encryption is not supported.
Is Hypapdf open source? Can I use it commercially?
Yes. The source is on GitHub and licensed under the Apache License 2.0, which permits commercial use. The package is published on NuGet.
How do I report bugs?
Open an issue in the GitHub repository at github.com/vensas/hypapdf. Include the package version and, if you can, the PDF or a minimal file that shows the problem.
Get the text out of your PDFs, fast.
Install one package and read your first document in a few lines.
With your consent, we use Matomo with cookies to see which pages, searches and buttons people use here. The data stays in the EU and is not shared. You can change your choice at any time under Cookie settings at the bottom of the page. Privacy policy