Repository navigation
Installation
pdfcpu2 is a single static binary built from pure Go. No runtime dependencies, no cgo, no system libraries.
git clone https://github.com/huzpsb/pdfcpu2.git
cd pdfcpu2
go mod vendor # vendor/ is not committed; regenerate before building
go build ./cmd/pdfcpu2The resulting pdfcpu2 (or pdfcpu2.exe) is fully self-contained: fonts, core PDF resources and the embedded OCR models are compiled in. Cross-compile anywhere Go runs:
GOOS=linux GOARCH=amd64 go build -o pdfcpu2_linux_amd64 ./cmd/pdfcpu2
GOOS=darwin GOARCH=arm64 go build -o pdfcpu2_darwin_arm64 ./cmd/pdfcpu2
GOOS=windows GOARCH=amd64 go build -o pdfcpu2_windows_amd64.exe ./cmd/pdfcpu2Offline build environments need a populated module cache before
go mod vendorsucceeds.
go get github.com/huzpsb/pdfcpu2import (
"github.com/huzpsb/pdfcpu2/pkg/api"
"github.com/huzpsb/pdfcpu2/pkg/pdfcpu/model"
)See Go API for the package layout and coding patterns.
pdfcpu2 completion bash # bash
pdfcpu2 completion zsh # zsh
pdfcpu2 completion fish # fish
pdfcpu2 completion powershell # PowerShellExample (bash, persistent):
pdfcpu2 completion bash > /etc/bash_completion.d/pdfcpu2Example (PowerShell, current session):
pdfcpu2 completion powershell | Out-String | Invoke-ExpressionMost commands work out of the box with zero configuration. On first use pdfcpu2 may create a small configuration directory (config.yml, user fonts, trusted certificates) — see Configuration to control, relocate or disable that.
pdfcpu2 validate in.pdfTo run fully stateless without touching the file system:
pdfcpu2 --conf disable validate in.pdfpdfcpu2 version
pdfcpu2 paper # lists supported paper sizes
pdfcpu2 fonts list # lists usable fonts incl. the 14 core fontspdfcpu2 wiki
Getting started
Fork features
Inspect
Document
Pages
Content
Extract
Resources
Security
Viewer
Trust
Developers