All formats

PDF libraries

PDF libraries do very different jobs, and few do all of them well. Before you pick one, decide what you need:

Check licenses: MuPDF (and PyMuPDF, go-fitz), iText, HexaPDF and PDFsharp 6.5+ are AGPL (or commercial); Poppler and mPDF are GPL; QuestPDF needs a paid license above $1M annual revenue.

Language Library Read Write Notes
C/C++ MuPDF yes yes fast rendering and text extraction, AGPL or commercial
C/C++ PDFium yes yes Chrome’s PDF engine, BSD license, rendering and forms
C/C++ Poppler yes limited rendering and text, GPL, standard on Linux
C/C++ QPDF yes yes structural edits: merge, split, encrypt, linearize, repair
C/C++ PoDoFo yes yes create and edit, text extraction, signing, LGPL
C/C++ libHaru no yes small C library for generating PDFs
C# PdfPig yes basic text extraction with layout analysis, Apache 2.0
C# PDFsharp yes yes create, merge, split, encrypt; AGPL or commercial since 6.5 (MIT up to 6.2)
C# QuestPDF no yes fluent layout API for reports and invoices, community license
C# iText yes yes everything incl. signatures and PDF/A, AGPL or commercial
Java Apache PDFBox yes yes text extraction, rendering, forms, signing, Apache 2.0
Java OpenPDF yes yes creation, LGPL/MPL fork of iText 4
Java iText yes yes everything incl. signatures and PDF/A, AGPL or commercial
Go pdfcpu yes yes merge, split, rotate, encrypt, forms, watermarks, pure Go
Go ledongthuc/pdf yes no simple text extraction, pure Go
Go go-fitz yes no MuPDF binding: render pages, extract text, AGPL
Python pypdf yes yes pure Python: merge, split, text, forms, encryption
Python pdfplumber yes no text with positions and table extraction
Python PyMuPDF yes yes MuPDF binding: fast text, rendering, editing, AGPL
Python pikepdf yes yes QPDF binding: low-level edits, repair, encryption
Python ReportLab no yes the standard PDF generator for Python
Python pdfminer.six yes no detailed text and layout extraction
Ruby HexaPDF yes yes create and modify, AGPL or commercial
Ruby Prawn no yes the standard PDF generator for Ruby
Ruby pdf-reader yes no text and metadata extraction
Ruby CombinePDF yes yes merge, split, stamp pages, pure Ruby
Rust lopdf yes yes object-level reading and editing
Rust pdf yes experimental typed object model for reading
Rust printpdf basic yes create PDFs with text, graphics, images
Rust pdfium-render yes yes PDFium binding: render, text, forms, edit
PHP TCPDF no yes create PDFs with HTML, barcodes, signatures; maintenance mode
PHP FPDF and FPDI import yes small generator, FPDI imports pages of existing PDFs
PHP Dompdf no yes HTML and CSS to PDF
PHP mPDF import yes HTML to PDF with good Unicode support, GPL
PHP PdfParser yes no text and metadata extraction, pure PHP

By language#