PDF libraries for C/C++
C and C++ have the most complete PDF libraries; most libraries in other languages wrap one of them.
- MuPDF renders and extracts text faster than anything else and also edits PDFs (merge, encrypt, annotations, forms). It also opens EPUB, XPS, CBZ and images. License: AGPL or commercial from Artifex.
- PDFium is the engine of Chrome’s PDF viewer: rendering, text, forms and basic editing under a BSD license. Its build system is Chromium’s, so most projects use prebuilt binaries.
- Poppler is the standard renderer on Linux (Evince, Okular,
pdftotext,pdftoppm). Good C++ and GLib APIs. License: GPL. - QPDF doesn’t render: it transforms the structure of PDF files. Merge, split, rotate, encrypt, decrypt, linearize and repair, with a well-designed C++ API and command line. Apache 2.0.
- PoDoFo creates and modifies PDFs: drawing text and graphics, fonts, forms, digital signatures and text extraction. LGPL or MPL.
- libHaru is a small C library that only writes PDFs: text, graphics, images, TrueType fonts, encryption. zlib license.
Pick MuPDF or PDFium to render pages or extract text (PDFium if AGPL is a problem), QPDF to merge, split or encrypt existing files, and PoDoFo or libHaru to generate new documents.
- libHaru libHaru (Haru Free PDF Library) is a small C library for generating PDF files. How to install it, create a PDF with text, use TrueType fonts with UTF-8.
- MuPDF MuPDF is a fast C library to render PDF pages, extract text and edit PDF files. How to install it, render a page to PNG, extract text, read metadata.
- PDFium PDFium is Google Chrome's open-source PDF engine with a C API. How to get it, render a PDF page to a bitmap, extract text, read metadata, merge PDFs.
- PoDoFo PoDoFo is a C++ library to create, read and modify PDF files. How to install it, create a PDF with text, extract text, merge PDFs, rotate pages, fill forms.
- Poppler Poppler is the PDF rendering library used by most Linux PDF viewers, with C++, GLib and Qt APIs. How to install it, render pages to PNG, extract text.
- QPDF QPDF is a C++ library and command-line tool for structural PDF transformations. How to merge and split PDFs, rotate pages, encrypt and decrypt, read metadata.