Skip to content

Small script which deletes meta data from PDFs using exiftool

License

Notifications You must be signed in to change notification settings

coffeemesh/PDFCleanser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PDFCleanser for Windows

Small batch script which deletes meta data from PDFs using exiftool. Some options might not be necessary but the whole thing should work. not guaranteeing that because of obvious reasons.

Usage:

  • Put your pdf, this script and the exiftool in the same folder and then run the script.

Refer to exifTool on how to install their software

Why does this exist?

This exists because from aproximately 10 tools I have tried on Windows, none of them had worked properly. So I implemented it myself and it worked

How to Use MetaDataDeleter.ps1

Prerequisites

  1. PowerShell: Ensure you have PowerShell 5.1 or later installed on your Windows machine.
  2. ExifTool: Download and extract exiftool from ExifTool's official website. Make sure you know the path to the exiftool.exe file.
  3. Execution Policy: Ensure your PowerShell execution policy allows running scripts. You can set it using the following command:
    Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

Steps to Use the Script

  1. Download the Script: Save the

MetaDataDeleter.ps1

script to a known location on your computer.

  1. Open PowerShell: Open PowerShell with administrative privileges.

  2. Navigate to the Script Location: Use the cd command to navigate to the directory where you saved the

MetaDataDeleter.ps1

script. For example:

cd C:\path\to\your\script
  1. Run the Script: Execute the script by typing:

    .\MetaDataDeleter.ps1
  2. Select ExifTool: A file dialog will appear prompting you to select the exiftool.exe file. Navigate to the location where you extracted exiftool and select exiftool.exe.

  3. Select PDF File: Another file dialog will appear prompting you to select the PDF file you want to modify. Navigate to the location of your PDF file and select it.

  4. View Metadata: The script will print the metadata of the PDF file before modification.

  5. Modify Metadata: The script will modify the metadata of the selected PDF file.

  6. View Modified Metadata: The script will print the metadata of the PDF file after modification.

  7. Exit: The script will wait for you to press Enter before closing, allowing you to review the output.

Example Output

Select ExifTool.exe to use
Select PDF File to modify
Metadata before modification:
Title: Original Title
Author: Original Author
Creator: Original Creator
CreateDate: 2021:01:01 00:00:00
ModDate: 2021:01:01 00:00:00
Metadata has been modified.
Metadata after modification:
Title: unknown
Author: unknown
Creator: unknown
CreateDate: 1970:01:01 00:00:00
ModDate: 1970:01:01 00:00:00
Press Enter to exit

Notes

  • The script modifies the metadata fields Title, Author, Creator, CreateDate, and ModDate to predefined values.
  • Ensure you have the necessary permissions to modify the PDF file.
  • The script includes basic error handling to manage common issues such as file not found or access denied.

About

Small script which deletes meta data from PDFs using exiftool

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published