pdfcpu

Logo

PDF tooling for Go and the command line.

View the Project on GitHub pdfcpu/pdfcpu


Changelog
Future Directions

Remove Annotations

This command removes annotation from a PDF document by object number.

Have a look at some examples.

Usage

pdfcpu annotations remove inFile [ outFile ] [ objNr | annotId | annotType]... [flags]

Common Flags


Arguments

namedescriptionrequired
inFilePDF input file, use - to read from stdinyes
outFilePDF output file, use - to write to stdoutno
objNr…one or more objNrsno
annotId…one or more annotIdsno
annotType…one or more annotTypesno

Examples

Remove annotation with object number 575 as taken from the output from pdfcpu annotations list:

$ pdfcpu annotations remove test.pdf 575
writing test.pdf...
pages: all

Remove annotations for first 5 pages:

$ pdfcpu annotations remove test.pdf --pages 1-5
writing test.pdf...
pages: 1,2,3,4,5

Remove all annotations:

$ pdfcpu annotations remove test.pdf
writing test.pdf...
pages: all

Remove link annotations from a streamed PDF and upload the result:

$ aws s3 cp s3://acme-redaction/review.pdf - \
   | pdfcpu annotations remove - - Link \
   | aws s3 cp - s3://acme-redaction/review-no-links.pdf