1
0
Fork 0
mirror of https://github.com/kanzure/pdfparanoia.git synced 2025-07-04 20:37:38 +02:00

SPIE watermark removal

This is slightly broken because the SPIE plugin removes more than just
watermarks. For some reason it seems to also remove images and large
blocks of text from the paper. However, the object that is being removed
is tiny. In the unit testing sample, the removed object is pdf stream
55.

For now, SPIE is partially disabled until this is fixed. The problem
does not originate from the other plugins.

fixes #20
This commit is contained in:
Bryan Bishop 2013-02-11 23:52:59 -06:00
parent 9d7fd1dbb6
commit caed396870
7 changed files with 74 additions and 2 deletions

14
tests/test_spie.py Normal file
View file

@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
import unittest
import pdfparanoia
class SPIETestCase(unittest.TestCase):
def test_spie(self):
file_handler = open("tests/samples/spie/266c86e6f47e39415584450f5a3af4d0.pdf", "rb")
content = file_handler.read()
self.assertIn("\n46 0 obj", content)
output = pdfparanoia.plugins.SPIE.scrub(content)
self.assertNotIn("\n55 0 obj", output)