Skip to content

Instantly share code, notes, and snippets.

@sneakers-the-rat
Last active July 16, 2024 10:34
Show Gist options
  • Save sneakers-the-rat/0d45d5a3bfb384ddf88f8815edfbb4b4 to your computer and use it in GitHub Desktop.
Save sneakers-the-rat/0d45d5a3bfb384ddf88f8815edfbb4b4 to your computer and use it in GitHub Desktop.
remove pdf metadata
####
# 1) install exiftool and qpdf
# https://exiftool.org/
# http://qpdf.sourceforge.net/
# (can be installed with homebrew: brew install exiftool qpdf )
####
# 2) remove metadata - this step is reversible, so we will need to recreate the PDF afterwards
exiftool -all:all= /location/of/some/file.pdf
####
# 3) linearize pdf - "commit" the previous changes
qpdf --linearize /location/of/some/file.pdf /location/of/some/other_file.pdf
####
# 4) confirm it's gone ya?
exiftool -all /location/of/some/other_file.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment