2021-08-10 15:41:18 +02:00
|
|
|
# CHAPTER 5. Compression
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def compress(pdf):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Compress any uncompressed streams in the given PDF using the Flate
|
|
|
|
algorithm."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def decompress(pdf):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Decompress any streams in the given PDF, so long as the compression
|
|
|
|
method is supported."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def squeezeInMemory(pdf):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""squeezeToMemory(pdf) squeezes a pdf in memory. Squeezing is a lossless
|
|
|
|
compression method which works be rearrangement of a PDFs internal
|