mirror of
https://github.com/kanzure/pdfparanoia.git
synced 2025-02-11 13:13:10 +01:00
![Bryan Bishop](/assets/img/avatar_default.png)
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
15 lines
407 B
Python
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)
|
|
|