/usr/lib/python2.7/dist-packages/pdfrw/compress.py is in python-pdfrw 0.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | # A part of pdfrw (https://github.com/pmaupin/pdfrw)
# Copyright (C) 2006-2015 Patrick Maupin, Austin, Texas
# MIT license -- See LICENSE.txt for details
'''
Currently, this sad little file only knows how to decompress
using the flate (zlib) algorithm. Maybe more later, but it's
not a priority for me...
'''
from .objects import PdfName
from .uncompress import streamobjects
from .py23_diffs import zlib
def compress(mylist):
flate = PdfName.FlateDecode
for obj in streamobjects(mylist):
ftype = obj.Filter
if ftype is not None:
continue
oldstr = obj.stream
newstr = zlib.compress(oldstr)
if len(newstr) < len(oldstr) + 30:
obj.stream = newstr
obj.Filter = flate
obj.DecodeParms = None
|