pdfparanoia is a PDF watermark removal library for academic papers. Some publishers include private information like institution names, personal names, ip addresses, timestamps and other identifying information in watermarks on each page.
pdfparanoia это библиотека для удаления водяных знаков из PDF файлов научных статей. Некоторые издатели включают личную информацию, такую как названия институтов, имена, IP-адреса, время и дату и другую информацию в водяные знаки содержащиеся на каждой странице.
Simple.
sudo pip install pdfparanoiaor,
sudo python setup.py installpdfparanoia is written for Python 2.7+ or Python 3. Dependencies are installed automatically by pip: pdfminer.six (publisher watermark plugins) and pikepdf (custom string + metadata scrubbing).
import pdfparanoia
pdf = pdfparanoia.scrub(open("nmat91417.pdf", "rb"))
with open("output.pdf", "wb") as file_handler:
file_handler.write(pdf)or from the shell,
pdfparanoia --verbose input.pdf -o output.pdfand,
cat input.pdf | pdfparanoia > output.pdfTo remove a specific string from all page content streams and metadata:
pdfparanoia input.pdf -s "Downloaded by user@example.com" -o output.pdfTo remove a string from metadata only (leaving page text untouched):
pdfparanoia input.pdf -s "My Institution" --only-scrub-metadata -o output.pdfMultiple -s flags can be combined, and matching is case-insensitive by default
(pass --case-sensitive to opt out). The -o flag is safe to use with the
same path as the input file.
- AIP
- IEEE
- JSTOR
- RSC
- SPIE (sort of)
- 0.0.18 - pikepdf-based CustomStrings plugin: TJ-kerning-aware content-stream scrubbing, XMP and DocInfo metadata scrubbing,
--scrub-strings/--only-scrub-metadataCLI flags, safe in-place-ooutput. - 0.0.13 - RSC
- 0.0.12 - SPIE
- 0.0.11 - pdfparanoia command-line interface. Use it by either piping in pdf data, or specifying a path to a pdf in the first argv slot.
- 0.0.10 - JSTOR
- 0.0.9 - AIP: better checks for false-positives; IEEE: remove stdout garbage.
- 0.0.8 - IEEE
BSD.