1
0
mirror of https://github.com/kanzure/pdfparanoia.git synced 2024-05-29 07:08:03 +02:00
pdfparanoia/tests/test_spie.py
Bryan Bishop caed396870 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
2013-02-11 23:52:59 -06:00

15 lines
407 B
Python

# -*- 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)