pdfcpu

Logo

PDF tooling for Go and the command line.

View the Project on GitHub pdfcpu/pdfcpu


Changelog
Future Directions

Extract Attachments

This command extracts attachments from a PDF document. If you want to remove an extracted document you can do this using attach remove. Have a look at some examples.

Usage

pdfcpu attachments extract inFile outDir [ file... ] [flags]

Common Flags


Arguments

namedescriptionrequired
inFilePDF input file, use - to read from stdinyes
outDiroutput directoryyes
file…one or more attachments to be extractedno

Examples

Extract a specific attachment from ledger.pdf into out:

$ pdfcpu attachments extract ledger.pdf out invoice1.pdf
writing out/invoice.pdf

Extract all attachments of ledger.pdf into out:

$ pdfcpu attachments extract ledger.pdf out
writing out/invoice1.pdf
writing out/invoice2.pdf
writing out/invoice3.pdf

Extract an attachment from a streamed PDF into a local output directory:

$ aws s3 cp s3://acme-archive/ledger.pdf - \
   | pdfcpu attachments extract - ./attachments invoice1.pdf