'Compresses the size of this page by joining all content streams and
applying a FlateDecode filter.
However, it is possible that this function will perform no action if
content stream compression becomes "automatic" for some reason.'

def compressContentStreams(self):

    content = self.getContents()
    if (content is not None):
        if (not isinstance(content, ContentStream)):
            content = ContentStream(content, self.pdf)
        self[NameObject('/Contents')] = content.flateEncode()
