mirror of
https://github.com/kanzure/pdfparanoia.git
synced 2025-07-03 03:47:25 +02:00
parent
47bc734318
commit
b7b5a4ef65
6 changed files with 128 additions and 4 deletions
BIN
tests/samples/jstor/231a515256115368c142f528cee7f727.pdf
Normal file
BIN
tests/samples/jstor/231a515256115368c142f528cee7f727.pdf
Normal file
Binary file not shown.
20
tests/test_jstor.py
Normal file
20
tests/test_jstor.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import unittest
|
||||
import pdfparanoia
|
||||
|
||||
class JSTORTestCase(unittest.TestCase):
|
||||
def test_jstor(self):
|
||||
file_handler = open("tests/samples/jstor/231a515256115368c142f528cee7f727.pdf", "rb")
|
||||
content = file_handler.read()
|
||||
file_handler.close()
|
||||
self.assertIn("\n18 0 obj \n", content)
|
||||
|
||||
# this section will later be manipulated
|
||||
self.assertIn("\n19 0 obj \n", content)
|
||||
|
||||
output = pdfparanoia.plugins.JSTOR.scrub(content)
|
||||
|
||||
# FlateDecode should be replaced with a decompressed section
|
||||
self.assertIn("\n19 0 obj\n<</Length 2862>>stream", output)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue