pdfparanoia command-line interface

This commit is contained in:
Bryan Bishop 2013-02-09 09:43:12 -06:00
parent 5c8a194445
commit 775b927b42
4 changed files with 32 additions and 2 deletions

View File

@ -36,6 +36,7 @@ file_handler.close()
## Changelog
* 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

28
bin/pdfparanoia Executable file
View File

@ -0,0 +1,28 @@
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""
pdfparanoia - pdf watermark removal tool
This is the command-line client. It accepts pdf formatted data either through
stdin/piping or by referencing a file in argv[0].
"""
if __name__ == "__main__":
import sys
import fileinput
from StringIO import StringIO
import pdfparanoia
# read in all lines
content = ""
for line in fileinput.input():
content += line
# scrub the pdf to get rid of watermarks
output = pdfparanoia.scrub(StringIO(content))
# dump to output
sys.stdout.write(output)

View File

@ -17,8 +17,8 @@ usage:
"""
__title__ = "pdfparanoia"
__version__ = "0.0.10"
__build__ = 0x000010
__version__ = "0.0.11"
__build__ = 0x000011
__author__ = "Bryan Bishop <kanzure@gmail.com>"
__license__ = "BSD"
__copyright__ = "Copyright 2013 Bryan Bishop"

View File

@ -24,6 +24,7 @@ setup(
long_description=long_description,
packages=packages,
install_requires=["pdfminer>=0"],
scripts=["bin/pdfparanoia"],
platforms="any",
zip_safe=False,
classifiers=[