Skip to content

Instantly share code, notes, and snippets.

@668
668 / pdf_remove_watermark.py
Created August 9, 2017 07:39 — forked from raphiz/pdf_remove_watermark.py
PDF watermark removal
from PyPDF2 import PdfFileReader, PdfFileWriter
from PyPDF2.pdf import ContentStream
from PyPDF2.generic import TextStringObject, NameObject
from PyPDF2.utils import b_
wm_text = 'Persönliches Exemplar von'
replace_with = ''
# Load PDF into pyPDF
source = PdfFileReader(open('input.pdf', "rb"))