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