Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Categories
Special pages
All pages
Search
Search
Appearance
Log in
Personal tools
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Stripping Metadata from PDFs
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
This guide will show you, from start to finish, how to: * Install and configure tools for scrubbing metadata * Show you how to use those tools to scrub metadata * Touch on some best practices for handling images and PDFs when you intend to publish them = Installation = == Windows == Before you begin you will need to install LibreOffice, Exiftool, and QPDF. While other document editors might be suitable, we recommend LibreOffice due to its open-source nature and '''highly suggest avoiding Microsoft Office'''. === Prerequisites === * Ensure you have administrative privileges for installations and PATH edits. * Winget must be available (included in Windows 10/11 via the App Installer; update it from the Microsoft Store if needed). If <code>winget</code> is not recognized in Command Prompt, install it manually from Microsoft's official GitHub repository: https://github.com/microsoft/winget-cli. === LibreOffice === To install LibreOffice on Windows, download it from their official download link below and run the installer: https://www.libreoffice.org/download/download-libreoffice/ === Exiftool === To install <code>exiftool</code> on Windows, first open a command prompt window (type Win+R, type in <code>cmd.exe</code>, and hit enter to open a prompt window) then copy/paste the following command in and hit enter. Follow the on screen instructions for the installer: <code>winget install --id OliverBetz.ExifTool -e</code> === QPDF === Install <code>qpdf</code> by entering the following command into the Command Prompt: <code>winget install --id QPDF.QPDF -e</code> Run the following to check the version that was installed. Take note of it: <code>winget list --id QPDF.QPDF</code> Open <code>C:\Program Files</code> and look for a folder titled <code>qpdf 12.2.0</code>. Yours may have a different version number. Copy the file path to the bin folder. The filepath will be something like <code>C:\Program Files\qpdf 12.2.0\bin</code>. Search for "edit system variables" in the Windows search bar and open it. Click on the "Environment variables" button. Click on "PATH" under user variables, then click "Edit". A new window will pop up. Click the new button and then paste the folder path to the qpdf bin folder. Click OK to close both windows. == Linux == Install <code>exiftool</code> and <code>qpdf</code> through your package manager. = Scrubbing the Data = == Scrub Images == '''NOTE''': It is important to scrub images '''before''' embedding them into your document. Scrubbing a PDF does not scrub any images inside of it. '''NOTE''': You should take backups of any images you perform this process on. Consider copying them into a new folder and then working on those copies. These instructions focus on JPEGs but can be adapted for other formats, like PNG or TIFF. Use <code>-ext png</code> for PNGs, or specify multiple with <code>-ext jpg -ext png</code>. Scrub only the images you'll embed; if your document includes vectors or other embeds (e.g., from LibreOffice Draw), they must be scrubbed separately. Make sure that all of the images have been scrubbed before you proceed to creating your pdf. Open a <code>cmd.exe</code> window and change directory to the new image folder (you did read the notes at the top of this section, right?). The command to do this is below. Be sure to use the correct filepath: <code>cd C:\[path to folder]\images</code> Scrub all JPEG images that will be inserted into the doc using <code>exiftool</code>. The command to do this is below. Be sure to use the correct file path: <code>exiftool -overwrite_original -all= -r -ext jpg C:\[path to folder]\images</code> == Create Your PDF == We recommend using '''LibreOffice''' to draft your documentation as we cannot fully trust Microsoft Office to not embed data into the resulting PDF in ways we have not yet discovered. In LibreOffice, you should then export to PDF through the "File > Export As > Export" menu. For other word processing software, such as MS Word (which we do not recommend that you use), we recommend that you save the document as a PDF - do not "print to PDF". == Scrub Your PDF == Scrub all PDF metadata with the command below. Be sure to use the correct file path: <code>exiftool -overwrite_original -all= C:\[path to folder]\input.pdf</code> Then, after scrubbing, linearize the PDF with QPDF to remove any remaining metadata stored in the file: <code>qpdf --linearize input.pdf output.pdf</code> To verify that your PDF has been scrubbed, run: <code>exiftool -a -G1 -s output.pdf</code> The output should show minimal metadata. No user-specific info should remain. You are now the proud author of a PDF document which has its metadata scrubbed. We know that this process is cumbersome and are working to have a cleaner solution available to the community soon. [[Category:Guides]]
Summary:
Please note that all contributions to GunCAD Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
GunCAD Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Stripping Metadata from PDFs
Add topic