Overview
UniPDF is a Golang PDF library to create, edit and annotate PDF documents in your application. You can embed full PDF functionality into your project in no time. UniDoc focuses on the complexities of document manipulation, including security, so you can deliver an improved product offering.
UniPDF v5 is the current major version. If you are upgrading from v4, the v5 migration guide covers the breaking changes.
Why UniPDF?
Secure by Design
Every release of our libraries is automatically tested against known vulnerabilities and does not pass unless everything is remediated. Our team carefully reviews all changes.
Fastest time to Deployment
Our SDKs libraries are flexible and developed to solve common problems. We provide high-level interfaces for common problem-solving and lower-level interfaces for less generic tasks.
Features
The library splits along one main line: building a document from nothing uses the
creator package, while reading or changing an existing one uses model together with
extractor.
Create a document
| Feature | What you can do |
|---|---|
| Tables | Build tables cell by cell, with spans, header rows repeated across pages, and control over page breaks. |
| Grid | The newer tabular component, with explicit rows and clearer span handling. |
| Text manipulation | Styled paragraphs, drop caps, right-to-left text and gradient fills. |
| Drawing | Lines and shapes. |
| Images | Place images on a page or build a document from a set of them. |
| Templates | Describe complex layouts as markup instead of Go calls, with less code. |
| Report | Reports and invoices: chapters, generated tables of contents, running headers and footers. |
Read and extract
| Feature | What you can do |
|---|---|
| Extraction | Pull out text, tables, images and fonts, with four extraction modes to suit the document. |
| Analysis | Inspect PDF internals: objects, content streams and document properties. |
| OCR | Recover text from scanned pages, using a separate OCR service. |
| Conversion | Render pages to JPEG and other image formats, with custom encoding. |
Modify an existing document
| Feature | What you can do |
|---|---|
| Page manipulation | Crop, rotate, reorder, split and merge pages. |
| Annotations | Mark up a document with comments and shapes without altering its original content. |
| Forms | Create, fill, flatten and export AcroForm fields, including form data as JSON. |
| Metadata | Read and write the document info dictionary and XMP metadata. |
| Outlines | Read and write the bookmark tree. |
| Attachments | Embed files in a document and retrieve them. |
| Watermark | Stamp text or an image across pages. |
| Redaction | Remove confidential information such as card numbers, emails or custom patterns by regex. |
| Search and replace | Find text by pattern and substitute it. |
| PDF optimization | Reduce file size with font subsetting, stream compression and object deduplication, and write linearized files for fast web view. |
Sign and secure
| Feature | What you can do |
|---|---|
| Signatures | Apply electronic and digital signatures, validate them, and read a document’s revision history. Covers external signing services, timestamps, LTV and the PAdES baseline levels. |
| Security | Encrypt a document, set a password, and control whether readers may copy, edit or print it. |
Standards and compliance
| Feature | What you can do |
|---|---|
| PDF/A | Apply and validate PDF/A conformance, parts 1 through 4. |
| Accessibility | Produce tagged PDF with a structure tree, and validate against PDF/UA-1 and PDF/UA-2. |
Performance
| Feature | What you can do |
|---|---|
| Concurrency | Process documents in parallel, or read pages of a single document across goroutines. |
Ready to Get Started?
Learn how to set up your development environment and get running with UniPDF using this quick start guide.