Package pdfcpu is a simple PDF processing library written in Go supporting encryption.
It provides both an API and a CLI. Supported are all versions up to PDF 1.7 (ISO-32000).
Improved image extraction (Flate encoded images get written as PNG)
Reducing the size of large PDF files for mass mailings by optimization to the bare minimum. This can be achieved by analyzing a PDF’s cross reference table, removing redundant embedded resources like font files or images and by always writing back the file maxing out PDF compression. I also wanted to have my own swiss army knife for PDFs written entirely in Go that allows me to trim, split and merge PDF content.
Validate (validates PDF files up to version 7.0)
Read (builds xref table from PDF file)
Write (writes xref table to PDF file)
Optimize (gets rid of redundancies like duplicate fonts, images)
Split (split a multi page PDF file into single page PDF files)
Merge (a set of PDF files into one consolidated PDF file)
Extract Images (extract all embedded images of a PDF file into a given dir)
Extract Fonts (extract all embedded fonts of a PDF file into a given dir)
Extract Pages (extract specific pages into a given dir)
Extract Content (extract the PDF-Source into given dir)
Please open an issue if you find a bug or want to propose a change.
Pull requests, bug fixes and issues are always welcome.
Usage of pdfcpu assumes you know about and respect all copyrights of any PDF content you may be processing. This applies to the PDF files as such, their content and in particular all embedded resources like font files or images. Credit goes to Renee French for creating our beloved Gopher.