WholeFiles

Licensing

PDF library licences: which allow commercial use

Eighteen widely used PDF libraries and tools with their licence and a plain yes or no on using them in a paid or ad-funded product without buying a licence.

The question comes up in every team that touches PDFs: "is this library safe to ship". The answer is often hard to find because it hides in a LICENSE file, and because two of the most capable libraries, Ghostscript and MuPDF, are licensed in a way that catches people out. This page lists the libraries people actually reach for, with the licence each project publishes as of September 2026, and a plain answer to one question: can a commercial product use it without paying for a licence. "Commercial" includes ad-funded websites and internal tools at a company, not only software you sell.

The licence that binds you is the one in the LICENSE file of the version you ship. Projects do change licence between versions, so read that file once before release.

The table

Library or tool Language Licence Commercial use without paying
pdf.js (Mozilla) JavaScript Apache-2.0 Yes
pdf-lib JavaScript MIT Yes
jsPDF JavaScript MIT Yes
Apache PDFBox Java Apache-2.0 Yes
PDFsharp (version 6 onwards) .NET MIT Yes
pdfcpu Go Apache-2.0 Yes
qpdf C++ Apache-2.0 Yes
PDFium (Google, used by Chrome) C++ BSD-3-Clause and Apache-2.0 Yes
pypdf Python BSD-3-Clause Yes
ReportLab, open source edition Python BSD-3-Clause Yes (ReportLab PLUS is a paid product)
Chromium print to PDF (Puppeteer, Playwright) C++ BSD-3-Clause Yes
LibreOffice headless conversion C++ MPL-2.0 Yes
wkhtmltopdf C++ LGPL-3.0 Yes, when called as a separate program or linked dynamically
Poppler (pdftotext, pdftoppm) C++ GPL-2.0 or GPL-3.0 Yes as a separate program; linking it into your own code makes your code GPL
Ghostscript C AGPL-3.0, or a paid licence from Artifex No
MuPDF C AGPL-3.0, or a paid licence from Artifex No
PyMuPDF (wraps MuPDF) Python AGPL-3.0, or a paid licence from Artifex No
iText 7 and later Java, .NET AGPL-3.0, or a paid licence from Apryse No

Why AGPL is the one to watch

The MIT, BSD and Apache licences ask for little more than keeping the copyright notice. The GPL asks that a program built from GPL code is itself released under the GPL, but only when the program is distributed, and running a website is not distribution. That is the loophole the AGPL closes: section 13 of the AGPL says that letting people interact with the program over a network counts. So a website that uses Ghostscript to compress uploaded PDFs must either publish its entire server code under the AGPL, or buy the commercial licence from Artifex. There is no third option, and Artifex, the company behind Ghostscript and MuPDF, sells that licence and enforces the choice.

The same logic applies to iText 7, which its owner Apryse licenses the same way, and to PyMuPDF, which is a wrapper around MuPDF and inherits its terms.

The mistake people make with Poppler and wkhtmltopdf

GPL and LGPL are about linking. If your program calls pdftotext as a separate process and reads its output, your program is not a derived work and stays under whatever licence you choose. If you compile Poppler's library into your program, your program becomes a derived work and the GPL applies to it. The LGPL, used by wkhtmltopdf, allows dynamic linking without that effect, which is why it is the friendlier of the two. Either way, calling the command-line tool is the safe pattern.

The practical short list

  • In the browser: pdf.js to draw pages, pdf-lib to build and edit them. Both are permissive, and both are what this site uses.
  • On a server, permissive only: qpdf for structural work, PDFBox on the JVM, pypdf in Python, PDFium or Chromium for rendering.
  • When you need Ghostscript's or MuPDF's quality: budget for the Artifex licence before you write the first line, or design around not needing it.

Sources

  1. Ghostscript licensing page, Artifex
  2. Artifex licensing page (MuPDF and Ghostscript)
  3. iText licensing, Apryse
  4. GNU Affero General Public License, version 3
  5. pdf.js repository
  6. pdf-lib repository
  7. Apache PDFBox
  8. qpdf repository
  9. PDFium, Google