OpenPDF and the iText 4.2.0 fork it still carries
OpenPDF is an open-source Java library for creating, editing, rendering, and encrypting PDF documents, as well as generating PDFs from HTML. It is licensed under the LGPL and MPL.
At a glance
- What is it?
- OpenPDF is a Java PDF library built on a fork of iText svn tag 4.2.0, split into core, HTML and renderer modules. It keeps the old iText API alive under LGPL and MPL, and it asks you to sanitize every byte you pass in.
- Who is it for?
- Adopt OpenPDF when your team already writes iText 4 code and needs to keep it without an AGPL conversation. Do not adopt it if you need iText 5 or newer features, or if untrusted file content will reach the library, because the project states it performs no input validation or sandboxing.
- Can I use it commercially?
- Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
- Is it still maintained?
- Yes. The repository last received commits 1 day ago.
- What is it written in?
- Mainly Java, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- LibrePDF/OpenPDF4,396 ★ · +26
| Repository | 2026-09-23 | 2026-11-15 |
|---|---|---|
| LibrePDF/OpenPDF | 4.4k | 4.4k |
26 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The fork point is iText svn tag 4.2.0, and that date matters
Every API name you will type into OpenPDF exists because of a specific legal decision made years earlier. The repository states that OpenPDF-core is a fork of iText version 4, specifically svn tag 4.2.0, forked in October 2016, and that iText itself started in 2000. It also names the lineage of GitHub parents, from ymasory's iText-4.2.0 up through daviddurand and kulatamicuda to rtfarte's OpenPDF and then LibrePDF/OpenPDF.
The split point is the reason the library exists. Beginning with version 5.0 of iText, the developers moved to the AGPL, which the README says was to improve their ability to sell commercial licenses. Version 4.2.0 carried LGPL and MPL headers, so a fork of that tag could keep those licenses. The SPDX identifier is `MPL-2.0 OR LGPL-2.1+`, and the core library ships under both. That is the whole product in one sentence: it is the last LGPL and MPL licensed iText, carried forward.
For an engineer, that predicts the shape of the API exactly. The project is not trying to be the current iText. It is a maintained branch of a specific old one.
Four modules with different licenses, which trips up packaging teams
The top level directory holds openpdf-core, openpdf-html, openpdf-renderer, openpdf-kotlin, openpdf-fonts-extra, pdf-swing and pdf-toolbox. Two of the sibling modules carry a different licence from the core, and that is the detail most adopters miss. The README states that openpdf-html and openpdf-renderer are licensed under GNU Lesser General Public License 2.1 only, while the main library is dual LGPL and MPL. If your organisation runs a licence scanner over transitive dependencies, openpdf-html resolves as LGPL-2.1 alone and openpdf as `MPL-2.0 OR LGPL-2.1+`.
Each module also has its own Maven coordinate. HTML to PDF conversion lives in `com.github.librepdf:openpdf-html`, a fork of Flying Saucer taken in June 2025 from a project that started in 2004. Rendering pages to images lives in `com.github.librepdf:openpdf-renderer`, a fork of PDFRenderer, which the README traces to Sun Labs in 2007.
So adding the HTML module is not a one dependency change. It pulls in an LGPL-only artifact with its own transitive tree, and your dependency graph ends up with two licence expressions where there was one. Plan for that before the scanner fails a release. The Kotlin module exists for Kotlin callers.
Adding openpdf 3.0.5 to a pom.xml is the entire install
There is no installer. OpenPDF is consumed as a library artifact from Maven Central, published under the groupId com.github.librepdf. The README gives the dependency block for the latest version, which at the time of writing is 3.0.5, released 2026-05-22.
Add this to your pom.xml file:
<dependency>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf</artifactId>
<version>3.0.5</version>
</dependency>That is the whole procedure. If you need the released jars rather than a dependency declaration, the README points to the releases page for the latest version and to the artifact listing on Maven Central. For a Gradle or other build tool, the coordinates are the same three values, and the wrapper scripts mvnw and mvnw.cmd at the repository root build the project from a checkout without a local Maven install.
Every example lives under `pdf-toolbox/src/test/java/org/openpdf/examples`, which is the closest thing the project has to a getting-started page, and the wiki Tutorial is marked work in progress. Expect to read those examples rather than a polished manual when you learn the API.
No input validation and no sandboxing, stated in the project itself
The Security Notice is blunt about what OpenPDF will not do for you. It says the application developer is responsible for ensuring that all input passed into OpenPDF is trusted, sanitized and safe, and that OpenPDF does not perform input validation or enforce sandboxing. Details are pushed into Security.md.
This is the sharpest edge in the project. A PDF parser is exactly the kind of component an attacker aims at, and this library is a parser for a format with fonts, streams and compressed objects. Any service that accepts a user-uploaded PDF and feeds it to OpenPDF inherits that responsibility in full. The feature list makes the reach obvious: creating documents, modifying existing ones by adding or removing pages and modifying text, extracting text, rendering pages to images, encrypting documents. That is a broad surface, and the same notice applies across all of it.
A close reading of the feature list also turns up a compression path that is newer than everything around it. Alongside PDF 2.0 support under ISO 32000-2, the library reads and writes streams compressed with Brotli through the `/BrotliDecode` filter. That is not part of iText 4.2.0. A parser carrying a new decompressor for attacker-controllable bytes is where you want fuzzing coverage.
A wiki tutorial still marked work in progress, and a sparse example tree
Documentation is the soft spot here. The README lists four pointers: the examples directory, hosted JavaDoc on javadoc.io, a Tutorial in the project wiki, and a Migration from iText 2 and 4 page. The Tutorial line carries the annotation work in progress, which tells you the wiki is incomplete rather than merely informal.
The JavaDoc is the part you can rely on, since it is generated from the source and covers the API surface the fork inherited. The migration wiki page is the one that matters most for anyone arriving from iText, because it is where the differences between the 2.x, 4.x and later iText worlds get described. There is no changelog in the documentation links either, although a `changelogs/` directory sits in the repository root.
The honest summary: the code is old, well known and heavily used, so the API knowledge exists elsewhere. The maintained artefact is the library itself. Documentation is the thing that was allowed to drift.
OpenPDF versus iText 5 and later, where the fork simply stops
The real comparison is not feature against feature, because the two projects diverge at a licence boundary. iText 5 moved to AGPL and commercial licensing. OpenPDF forked the 4.2.0 tag before that move and stayed on LGPL and MPL. A team choosing between them is deciding between a licence obligation and an API generation, and that decision comes before any question about which one renders a table better.
The difference in approach is concrete. iText 5 and later were developed forward, with newer document models, parser improvements and support for the PDF versions that appeared after 4.2.0. OpenPDF advances its own line, and the PDF 2.0 support under ISO 32000-2 and the Brotli filter show it does take on new specification work. What it does not do is pull in the iText 5 plus API, because doing so would mean importing AGPL licensed code, and the contributing rules say GPL or AGPL licensed code will not be acceptable and contributions must be code you wrote yourself.
If your requirement is a current iText API, OpenPDF is the wrong answer regardless of its merits.
Release cadence and what a dual licence means for your build
The repository is not archived, and its last push was on 2026-10-12.
The licence itself is a choice you make per use. The README frames it as dual licensing, letting you pick MPL 2.0 or LGPL 2.1, and states that the codebase is meant to stay consistently licensed under those two only. If you choose LGPL 2.1, your obligations around relinking and modification are the ones that licence already imposes. The compliance question belongs to whoever owns your legal review, not to the dependency entry in your pom.
One more project rule shapes the ecosystem. To contribute code, your GitHub account must contain your real name, so identity can be verified, an explicit guard against the kind of incident the README names when it cites the XZ Utils backdoor. That has no effect on using the library.
Editorial conclusion
Adopt OpenPDF when your team already writes iText 4 code and needs to keep it without an AGPL conversation. Do not adopt it if you need iText 5 or newer features, or if untrusted file content will reach the library, because the project states it performs no input validation or sandboxing. Before anything else, compile one of your existing iText 4 classes against version 3.0.5 and see what breaks.
Frequently asked questions
Is OpenPDF free to use?
Yes. OpenPDF is an open source Java library offered under dual licensing, so you may choose Mozilla Public License 2.0 or GNU Lesser General Public License 2.1. The SPDX identifier for the core library is MPL-2.0 OR LGPL-2.1+.
Is OpenPDF safe to use?
The project's own Security Notice says it is the responsibility of the application developer to ensure that all input passed into OpenPDF is trusted, sanitized and safe. OpenPDF does not perform input validation or enforce sandboxing, so treat any untrusted PDF as your problem to sanitize before it reaches the library.
Is OpenPDF free for commercial use?
The README describes dual licensing under MPL 2.0 or LGPL 2.1 rather than a commercial licence, and notes that OpenPDF exists as the LGPL and MPL successor to iText after iText version 5.0 moved to the AGPL. Whether a given commercial use meets your obligations is a question for your legal review.
How do I install OpenPDF?
Add the com.github.librepdf:openpdf dependency to your pom.xml at version 3.0.5, which is the latest release listed. For HTML to PDF conversion the separate artifact is com.github.librepdf:openpdf-html, and for page rendering it is com.github.librepdf:openpdf-renderer.
What is OpenPDF?
It is a Java library for creating, editing, rendering and encrypting PDF documents and for generating PDFs from HTML. OpenPDF-core is a fork of iText svn tag 4.2.0 taken in October 2016.
Is OpenPDF open source?
Yes, and it is a fork rather than a from-scratch project. The README lists the GitHub ancestors in fork order, from ymasory's iText-4.2.0 through intermediate forks to rtfarte's OpenPDF and LibrePDF/OpenPDF.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/librepdf-openpdf)Star history chart for your README
[](https://hysenlabs.com/projects/librepdf-openpdf)Was this useful?