diff options
author | ben | 2018-09-28 22:55:53 +0200 |
---|---|---|
committer | ben | 2018-09-28 22:55:53 +0200 |
commit | 7e962d60ad8f4eaf9defa1cc017d61a8ada4dc47 (patch) | |
tree | 096db297bfaf9d203d3c8b178b4b20b93c9bd615 /PolyglotFile/polyglotszippdf.py | |
parent | 79ddd879c3bd0cbd80d6332d4d046e2e10a5405f (diff) | |
download | truepolyglot-7e962d60ad8f4eaf9defa1cc017d61a8ada4dc47.tar.gz truepolyglot-7e962d60ad8f4eaf9defa1cc017d61a8ada4dc47.tar.bz2 truepolyglot-7e962d60ad8f4eaf9defa1cc017d61a8ada4dc47.tar.xz |
Add acrobat reader compatibility for szipdf format1.4.1
Diffstat (limited to 'PolyglotFile/polyglotszippdf.py')
-rw-r--r-- | PolyglotFile/polyglotszippdf.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/PolyglotFile/polyglotszippdf.py b/PolyglotFile/polyglotszippdf.py index 0796946..eadf5d0 100644 --- a/PolyglotFile/polyglotszippdf.py +++ b/PolyglotFile/polyglotszippdf.py @@ -28,8 +28,9 @@ from PdfFileTransformer import Pdf class PolyglotSZipPdf(PolyglotPdfZip): - def __init__(self, Pdf, Zip): + def __init__(self, Pdf, Zip, acrobat_compatibility): super().__init__(Pdf, Zip) + self.acrobat_compatibility = acrobat_compatibility def get_rebuild_zip_first_part_size(self): @@ -82,7 +83,11 @@ class PolyglotSZipPdf(PolyglotPdfZip): new_pdf.file_offset = offset pdf_buffer = new_pdf.get_build_buffer() j2 = pdf_buffer[k2_stream_offset + size_k2_stream:] - new_zip.add_data_to_file(b'', j2, True) + + if self.acrobat_compatibility: + new_zip.add_data_to_file(b'\x00', j2, True) + else: + new_zip.add_data_to_file(b'', j2, True) return new_zip.buffer |