Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A Python script for stripping out metadata from a PDF file.
import os
from PyPDF2 import PdfFileReader, PdfFileMerger
files_dir = os.getcwd()
if 'stripped' not in os.listdir(files_dir):
for f in os.listdir(files_dir):
if f.split('.')[-1] == 'pdf':
merger = PdfFileMerger()
merger.append(PdfFileReader(f, 'rb'))

This comment has been minimized.

Copy link

@positivedefinite positivedefinite commented Jul 30, 2019

this isn't working anymore :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment