# pdfcpu

> PDF processing library and CLI written in Go for validating, merging, splitting, encrypting, stamping, signing and extracting content from PDFs.

Stars: 8.9k · Language: Go · License: Apache-2.0 · Categories: File Management

- Repository: https://github.com/pdfcpu/pdfcpu
- Website: http://pdfcpu.io/
- Page: https://www.trmn.sh/tools/pdfcpu

## Overview

pdfcpu is a PDF processing library and command-line tool written in Go. The CLI exposes subcommands for common PDF operations, for example `pdfcpu validate input.pdf` to check a file and `pdfcpu merge merged.pdf in1.pdf in2.pdf` to combine documents. It supports PDF versions up to PDF 2.0 (ISO 32000-2), though PDF 2.0 validation is described as basic.

The command set covers validating, optimizing, splitting, trimming, merging, cropping, resizing and rotating pages. It also covers encrypting and decrypting files, changing owner and user passwords, and setting permissions. Other commands handle stamps and watermarks, extracting images, fonts, and metadata, and managing attachments, portfolios, bookmarks, annotations, forms, and keywords. Signature support includes validating signature integrity, reporting signature evidence, and removing signatures. Layout and generation commands include nup, grid, booklet, poster, ndown, cut, create, and import. Per-command help is available through `pdfcpu [command] --help`.

The same functionality is available as a Go API (documented on pkg.go.dev), so Go developers can embed PDF processing in applications and batch pipelines. The project lists minimal external dependencies as a focus. Its users are developers and operators who need to script PDF manipulation or process PDFs programmatically. For bug reports on unprocessable files, the maintainers ask users to run `pdfcpu validate -vv <file.pdf>` and include the output.

## Alternatives

- [lf](https://www.trmn.sh/tools/lf.md): Terminal file manager written in Go inspired by ranger with vi-style keybindings and shell integration (Go, 9.6k stars)
- [superfile](https://www.trmn.sh/tools/superfile.md): Terminal-based file manager with dual-pane interface, written in Go (Go, 24.0k stars)
- [croc](https://www.trmn.sh/tools/croc.md): Secure file transfer tool that enables any two computers to transfer files using end-to-end encryption and relay servers (Go, 40.8k stars)
- [rclone](https://www.trmn.sh/tools/rclone.md): Command-line program to sync files and directories to and from 70+ cloud storage providers (Go, 60.6k stars)
- [syncthing](https://www.trmn.sh/tools/syncthing.md): Continuous file synchronization program that syncs files between multiple computers using peer-to-peer connections (Go, 89.8k stars)

---

Canonical: https://www.trmn.sh/tools/pdfcpu
