icepdf

Apache 2.0 · Java 11+

Fast, pure-Java PDF rendering. Headless or in a desktop viewer.

icepdf parses and renders PDF documents with nothing but Java, at speeds that keep pace with native renderers. Embed it in a server to rasterize pages, or ship one of the two ready-made viewers, JavaFX or Swing, with annotations, forms, search, redaction and digital signatures built in.

<dependency>
  <groupId>com.github.pcorless.icepdf</groupId>
  <artifactId>icepdf-core</artifactId>
  <version>8.0.0</version>
</dependency>
The icepdf JavaFX viewer showing a field report with highlights, and a comments panel listing notes from four reviewers
0.1 sto open a 195 MB manual and render its first 20 pages
10–14 msper page for a typical technical datasheet
<1 sfor a six-sheet CAD set drawn with 122,000 images
<1 minto page through a 54,000-page document

First three: open and render, one page at a time at 72 dpi, median of three runs on a desktop Ryzen 9 with JDK 26.

What it does

One library, from headless rasterizing to a full desktop viewer.

Accurate rendering

Transparency groups blend against the real page backdrop, CMYK stays CMYK while blending, and knockout groups, all seven shading types, tiling patterns and soft masks are supported.

Fast and parallel

Images decode in parallel and pages render on a pool that scales to many-core machines. Glyph outlines are cached per font and colour conversion is memoized, so catalogues, maps and CAD sheets with 100k+ tiny images all render quickly.

Large documents, small heap

Big files are memory-mapped, image decodes and caches work within memory budgets, and huge images are decoded at the resolution they are drawn at. A 322 MB manual renders in a 1 GB heap.

True redaction

Redaction removes the text and image content underneath, not just a black box drawn on top. Search-and-redact also cleans bookmarks, annotations, form fields and metadata, then reports what it removed.

Digital signatures

Sign documents, including PDF/A, with visible appearances and recorded signing times. Validate existing signatures for integrity, certificate trust and the modifications made after signing.

Annotations and forms

Create and edit markup, free text, ink, links and stamps. Fill AcroForm fields with appearances laid out the way Acrobat lays them out, then reset, submit or save.

Text, search and extraction

Column-aware reading order, keyboard text selection with a caret, accent-insensitive search, and text and image extraction for indexing and analysis.

Pure Java, light dependencies

No native code. JPEG 2000 through the bundled pure-Java jpx-imageio, CCITT fax through icepdf's own decoder, and fonts through Apache FontBox. Export pages to PNG, JPEG, TIFF or SVG.

Two viewers, ready to embed

JavaFX new in 8.0

PdfView is a control you drop into your own scene. PdfViewer is the full reference viewer built from it, with tabs, annotations, forms, signing, redaction, printing, high-contrast themes and 13 languages.

The JavaFX annotation board: the report's comments as cards in four colour-label columns, To check, Numbers, Figures and Questions

Swing

The long-standing Swing viewer, built from SwingController and SwingViewBuilder. Use the whole window or just the viewer panel, with the same core features: search, redaction, signatures and forms.

The icepdf Swing viewer with the search panel listing five matches across three pages, and the matches highlighted on the page

See it in action

Short clips of the JavaFX reference viewer. They use a fictional field report (PDF, 1 MB) that you can open in the viewer yourself.

Search and redact Find every phone and permit number with one search, redact them all, and export a copy where the text is gone, not covered. Full clip (22 s)
Sign a document Fill in the form, draw a signature, sign with a certificate, and check the signed copy. Full clip (19 s)
Annotation board Review comments as cards: drag one to re-label it, group by author, filter as you type. Full clip (30 s)

Get started

Core runs on Java 11. The JavaFX viewer needs Java 17.

<dependency>
  <groupId>com.github.pcorless.icepdf</groupId>
  <artifactId>icepdf-core</artifactId>
  <version>8.0.0</version>
</dependency>
<!-- Swing viewer: icepdf-viewer, JavaFX viewer: icepdf-viewer-fx -->
<!-- optional bundled fonts: icepdf-fonts -->
Document document = new Document();
document.setFile("input.pdf");

float scale = 2f, rotation = 0f;
Page page = document.getPageTree().getPage(0);
page.init();
PDimension size = page.getSize(Page.BOUNDARY_CROPBOX, rotation, scale);

BufferedImage image = new BufferedImage((int) size.getWidth(), (int) size.getHeight(),
        BufferedImage.TYPE_INT_RGB);
Graphics2D g = image.createGraphics();
page.paint(g, GraphicsRenderingHints.PRINT, Page.BOUNDARY_CROPBOX, rotation, scale);
g.dispose();

ImageIO.write(image, "png", new File("page-1.png"));
document.dispose();

More in the examples (capture, extraction, annotation, redaction, signatures, search, printing) and on the wiki.

Support

Questions

Ask and share in GitHub Discussions. Check the wiki first; it covers configuration and the system properties.

Bugs and features

Open an issue. A sample PDF that shows the problem gets it fixed fastest. Pull requests are welcome; see CONTRIBUTING.

Sponsor

icepdf is maintained in the open. If your product depends on it, sponsoring pays for the triage, fixes and releases that keep it working.

Sponsor on GitHub