Skip to content

Instantly share code, notes, and snippets.

@tonytx05
tonytx05 / remove_pdf_annotation_author.py
Created October 2, 2023 17:39
Script to remove author names from all annotations in a PDF.
from pypdf import PdfReader, PdfWriter
reader = PdfReader('input.pdf')
writer = PdfWriter()
for page in reader.pages:
if '/Annots' in page:
for annot in page['/Annots']:
obj = annot.get_object()
if '/T' in obj: