Skip to main content

PDF Document API for Java

  • 3 minutes to read

The PDF Document API is a cross-platform Java library that allows you to create, load, modify, convert, and secure PDF documents programmatically.

The API exposes a document object model (DOM) that allows you to inspect and modify document structures such as pages, content fragments, annotations, form fields, and logical structure elements.

Simplified object model
PdfDocument
└─ Page
    ├─ TextFragment
    ├─ ImageFragment
    ├─ Annotation
    └─ FormField
Content object model
Create content objects such as TextFragment or ImageFragment and configure their properties. You can create, inspect, modify, reorder, or remove these elements.
True cross-platform support
Runs on Windows, Linux, and macOS without platform-specific dependencies.
Tagged PDF documents
Create and edit tagged PDF documents that include a logical structure tree. Tagged PDF documents improve accessibility and help you create PDF/UA-compliant documents.

Get Started

Follow the step-by-step tutorial to learn the basic workflow and understand the fundamental API patterns.

Read Tutorial: Create Your First PDF Document

Features

Create PDF Documents

Create PDF documents from scratch. Add text, images, vector graphics, and reusable templates to build document layouts.

Read Tutorial

Manage PDF Documents

Load existing PDF documents, merge multiple files, transform page content, search and replace text, attach files, and save document changes.

Read Tutorial

Manage Pages

Insert, remove, reorder, resize, and rotate pages to organize document layout.

Read Tutorial

Export PDF Pages to Images

Render PDF pages as image files for preview, printing, or integration with other applications.

Read Tutorial

Bookmarks

Create bookmark hierarchies, customize bookmark appearance, and associate bookmarks with destinations or actions.

Read Tutorial

Interactive Forms (AcroForms)

Create interactive PDF forms, access and modify form fields, format field values, organize form fields, and import or export form data.

Read Tutorial

Annotations

Add, edit, and remove PDF annotations. The API supports markup, text markup, drawing, document navigation, file and multimedia, watermark, printer mark, and trap network annotations.

Read Tutorial

Accessibility and Compliance

Generate tagged PDF documents for accessible content and create ZUGFeRD-compliant PDF invoices.

Read Tutorial

Secure PDF Documents

Protect PDF documents with encryption, passwords, and access permissions.

Read Tutorial

Document Metadata

Read, create, and modify PDF document metadata, including document information and XMP metadata.

Read Tutorial

Demos

Explore Office & PDF File API demos in the following GitHub repository. Each project is a standalone Java application that demonstrates a specific API feature and can serve as a starting point for your own projects.

View Example: Demos — Office & PDF File API for Java