Watch
1
Fork
You've already forked pdfparanoia
0
mirror of https://github.com/kanzure/pdfparanoia.git synced 2026-10-13 16:23:51 +02:00
No description
  • Python 95.5%
  • Shell 4.1%
  • Makefile 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Bryan Bishop f8b32618d2
Merge pull request #58 from nmz787/pikepdf-custom-strings-and-metadata
use pikepdf for custom string scrubbing from page text and metadata
2026-05-07 13:51:17 -05:00
bin update custom_strings scrubbing to use pikepdf so it can scrub "TJ operator" strings. pikepdf also can scrub XMP & DocumentInfo metadata, so doing that as well. update setup.py to use maintained version of PDFminer, adding pdfpike as requirement for custom_strings scrubbing 2026-05-07 01:39:25 -07:00
pdfparanoia update custom_strings scrubbing to use pikepdf so it can scrub "TJ operator" strings. pikepdf also can scrub XMP & DocumentInfo metadata, so doing that as well. update setup.py to use maintained version of PDFminer, adding pdfpike as requirement for custom_strings scrubbing 2026-05-07 01:39:25 -07:00
tests update custom_strings scrubbing to use pikepdf so it can scrub "TJ operator" strings. pikepdf also can scrub XMP & DocumentInfo metadata, so doing that as well. update setup.py to use maintained version of PDFminer, adding pdfpike as requirement for custom_strings scrubbing 2026-05-07 01:39:25 -07:00
.gitignore comparediffs seems to be working nicely 2013-05-02 22:45:34 +10:00
Makefile further updates to Makefile 2020-09-07 09:33:54 -05:00
MANIFEST.in include README.md via MANIFEST.in 2013-02-05 04:17:05 -06:00
README.md update custom_strings scrubbing to use pikepdf so it can scrub "TJ operator" strings. pikepdf also can scrub XMP & DocumentInfo metadata, so doing that as well. update setup.py to use maintained version of PDFminer, adding pdfpike as requirement for custom_strings scrubbing 2026-05-07 01:39:25 -07:00
requirements.txt Package: use a version of PDFMiner since the interface change (#37). 2013-12-07 07:23:47 +08:00
setup.py update custom_strings scrubbing to use pikepdf so it can scrub "TJ operator" strings. pikepdf also can scrub XMP & DocumentInfo metadata, so doing that as well. update setup.py to use maintained version of PDFminer, adding pdfpike as requirement for custom_strings scrubbing 2026-05-07 01:39:25 -07:00

pdfparanoia

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-адреса, время и дату и другую информацию в водяные знаки содержащиеся на каждой странице.

Installing

Simple.

sudo pip install pdfparanoia

or,

sudo python setup.py install

pdfparanoia 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).

Usage

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.pdf

and,

cat input.pdf | pdfparanoia > output.pdf

To remove a specific string from all page content streams and metadata:

pdfparanoia input.pdf -s "Downloaded by user@example.com" -o output.pdf

To remove a string from metadata only (leaving page text untouched):

pdfparanoia input.pdf -s "My Institution" --only-scrub-metadata -o output.pdf

Multiple -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.

Supported

  • AIP
  • IEEE
  • JSTOR
  • RSC
  • SPIE (sort of)

Changelog

  • 0.0.18 - pikepdf-based CustomStrings plugin: TJ-kerning-aware content-stream scrubbing, XMP and DocInfo metadata scrubbing, --scrub-strings / --only-scrub-metadata CLI flags, safe in-place -o output.
  • 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

License

BSD.