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.
- 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
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
- PowerShell: Ensure you have PowerShell 5.1 or later installed on your Windows machine.
- ExifTool: Download and extract
exiftool
from ExifTool's official website. Make sure you know the path to theexiftool.exe
file. - Execution Policy: Ensure your PowerShell execution policy allows running scripts. You can set it using the following command:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
- Download the Script: Save the
MetaDataDeleter.ps1
script to a known location on your computer.
-
Open PowerShell: Open PowerShell with administrative privileges.
-
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
-
Run the Script: Execute the script by typing:
.\MetaDataDeleter.ps1
-
Select ExifTool: A file dialog will appear prompting you to select the
exiftool.exe
file. Navigate to the location where you extractedexiftool
and selectexiftool.exe
. -
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.
-
View Metadata: The script will print the metadata of the PDF file before modification.
-
Modify Metadata: The script will modify the metadata of the selected PDF file.
-
View Modified Metadata: The script will print the metadata of the PDF file after modification.
-
Exit: The script will wait for you to press Enter before closing, allowing you to review the 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
- The script modifies the metadata fields
Title
,Author
,Creator
,CreateDate
, andModDate
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.