Manage Your PDF Files Easily with pdfcpu

If you are looking for a powerful tool to handle PDF files, pdfcpu is one of the best choices. It is a fast, open-source PDF processor written in Go. You can use it as a command-line tool or as a library in your Go projects.


  • Extract/Trim: Select and save specific pages.
  • Merge: Join multiple PDF files into one.
  • Split: Divide a large PDF into smaller files.
  • Optimize: Reduce PDF file size.
  • Security: Add or remove passwords and watermarks.
  • and mores

You can download the pre-built binaries for your operating system (Windows, Linux, or macOS) from the official GitHub page:

  1. Go to github.com/pdfcpu/pdfcpu/releases.
  2. Find the latest version (e.g., v0.11.1).
  3. Download the .tar.xz or .zip file for your system (e.g., Linux_x86_64).
  4. Extract the file and move the pdfcpu binary to your /usr/local/bin folder.

Here are some simple commands to get you started:

If you want to pull out pages 1 to 3 and save them as separate files:

1
pdfcpu extract -mode page -pages 1-3 input.pdf .

If you want to create a new file named output.pdf containing only pages 1, 2, and 3:

1
pdfcpu trim -pages 1-3 input.pdf output.pdf

To combine part1.pdf and part2.pdf into a single file:

1
pdfcpu merge merged.pdf part1.pdf part2.pdf

To make your PDF file smaller for emailing:

1
pdfcpu optimize input.pdf

To see useage:

1
pdfcpu help

pdfcpu is small but very powerful. It is perfect for developers and users who love simple command-line tools. Give it a try and save your time today!

Related Content