Skip to content

Instantly share code, notes, and snippets.

@KernelGhost
Last active August 5, 2026 10:03
Show Gist options
  • Select an option

  • Save KernelGhost/2d6861bac3de5bdc781b9f8b4fad273b to your computer and use it in GitHub Desktop.

Select an option

Save KernelGhost/2d6861bac3de5bdc781b9f8b4fad273b to your computer and use it in GitHub Desktop.
This guide offers concise steps to remove metadata from PDF files on Linux, macOS and Windows.

Removing PDF Metadata

Author: Rohan Barar
Date: 16/12/2023

GNU+Linux

  1. Install exiftool.
    sudo dnf install perl-Image-ExifTool
  2. Install qpdf.
    sudo dnf install qpdf
  3. Run the following command.
    exiftool -all:all= input.pdf -o intermediate_output.pdf
  4. Run the following command.
    qpdf --linearize intermediate_output.pdf final_output.pdf

macOS

  1. Install exiftool via Homebrew.
    brew install exiftool
  2. Install qpdf via Homebrew.
    brew install qpdf
  3. Run the following command.
    exiftool -all:all= input.pdf -o intermediate_output.pdf
  4. Run the following command.
    qpdf --linearize intermediate_output.pdf final_output.pdf

Windows

  1. Download exiftool as a stand-alone executable.
  2. Install qpdf.
  3. Run the following command.
    & "C:\Path\To\exiftool.exe" -all:all= input.pdf -o intermediate_output.pdf
  4. Run the following command.
    & "C:\Program Files\qpdf 11.6.4\bin\qpdf.exe" --linearize intermediate_output.pdf final_output.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment