UniPDF Package Overview
The library is layered. core handles the file format, model turns it into documents
and pages, and everything else is built on those two. Most applications only ever
import a few of them.
| Package | What it is for |
|---|---|
creator | Building content: paragraphs, tables, grids, images, chapters, invoices. High level enough that no knowledge of the PDF format is needed. Also draws on top of pages read from an existing file. |
model | The document as a structure of pages, fonts, annotations, form fields and outlines. PdfReader and PdfWriter live here, and this is where you go for anything the creator does not expose. |
extractor | Getting content back out of a page: text, tables, images, fonts, and the individual text marks with their positions and fonts. |
core | The primitive object types, the parser, cross-reference tables, encryption and the stream filters. Reach for it directly when you need a specific encoder or want to edit raw objects. |
render | Rasterizing a page. ImageDevice renders to a Go image.Image or straight to a PNG or JPEG file. |
common/license | SetMeteredKey and SetLicenseKey. Every program needs one of them before its first call into the library. |
Beyond those, several packages exist for one job each:
annotator creates form fields and signature appearances with the appearance streams
that viewers need to display them consistently. contentstream parses and builds the
operator stream behind a page, which is the level search and replace and redaction work
at. model/optimize holds the compression passes attached to a writer through
SetOptimizer. model/sighandler implements the signature handlers used to sign and
validate. redactor removes matched text and covers the area it occupied. ocr is an
HTTP client for an external recognition service; UniPDF does not recognize text in
images itself. fdf and fjson load form field data from FDF files and from JSON.
pdfutil collects a few page-level helpers such as grayscale conversion and page range
extraction. ps implements PostScript calculator functions, used by type 4 PDF
functions.
Full API documentation for every package is at apidocs.unidoc.io, and the overview groups the features by what you are trying to do rather than by package.