Introduction
![]()
pidief is a self-hosted PDF toolkit with a CLI and an HTTP API that do exactly the same things. Both are generated from one operation table, so pidief pages rotate and POST /v1/pages/rotate take the same parameters and cannot drift apart.
It is meant for business applications that need PDFs: contracts and documents from HTML templates, reports with long tables, statements, receipts, scans from phones, previews in a file manager, merging and splitting, watermarks, passwords and PDF/A, all without licensing traps.
Main features
- HTML to PDF with headless Chromium: A4 or custom paper, margins, landscape, header and footer templates, "page X of Y", embedded fonts (Onest included, with full Turkish support), CSS print, table headers repeated on every page, wait conditions, external resources blocked by default, and timeouts.
- Template + JSON to PDF, plus an HTML preview of the same template (Handlebars/Mustache syntax, loops, conditions, and Turkish money, date and amount-in-words helpers).
- Images to PDF for phone scans: JPEG, PNG, WebP, GIF, TIFF and BMP, with EXIF orientation, fit to page, a DPI cap and compression.
- PDF editing: merge, split, select/delete/rotate pages, watermark, stamp, compress, PDF/A-2b, encrypt/decrypt and metadata.
- PDF to image (PNG, JPEG or WebP, with DPI and thumbnails), page information and text extraction.
- A typed .NET client (
Pidief.Client) for calling the HTTP API.
Platform and requirements
- A single static Go binary (no cgo) plus Chromium.
- Docker image of about 256 MiB for linux/amd64 and linux/arm64.
- CLI binaries for Linux, macOS and Windows (amd64 and arm64).
- HTML and template commands need Chrome or Chromium on the machine; all other commands do not.
- Building from source needs Go 1.26 or later.
The service is stateless: inputs and results stay in memory and documents are never written to disk.
Example output
The repository's examples/annual-report folder builds a six-page report with a full-bleed cover, JavaScript charts, a landscape page, a long table, page numbers, a seal and PDF/A-2b.
Out of scope
- Office to PDF: the only clean option, LibreOffice (MPL-2.0), would roughly quadruple the image. It may come later as a separate
pidief-officeimage. - HEIC: the decoder (libde265) is LGPL and HEVC has patent risk. Send JPEG; HEIC input returns a clear 400 error.
- PDF/A-1, PDF/A-3, PDF/UA: only PDF/A-2b is produced. PDFs with non-embedded fonts are rejected for PDF/A, and colours are not converted.
- Digital signatures, form filling and OCR.
License
pidief is licensed under the Apache License 2.0. Every dependency is permissively licensed; third-party notices are in the NOTICE file of the repository.
Links
- GitHub repository: github.com/Milvasoft/pidief
- Website: pidief.milvasoft.com
- CLI binaries: GitHub Releases
- Docker image:
ghcr.io/milvasoft/pidief(GitHub Container Registry) - .NET client: Pidief.Client on NuGet