You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`def compress_content_streams(self, level: int = -1) -> None:
"""
Compress 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".
"""
content = self.get_contents()
if content is not None:
content_obj = content.flate_encode(level)
try:
content.indirect_reference.pdf._objects[ # type: ignore
content.indirect_reference.idnum - 1 # type: ignore
] = content_obj
except AttributeError:
if self.indirect_reference is not None and hasattr(
self.indirect_reference.pdf, "_add_object"
):
self.replace_contents(content_obj)
else:
raise ValueError("Page must be part of a PdfWriter")`
The text was updated successfully, but these errors were encountered:
`def compress_content_streams(self, level: int = -1) -> None:
"""
Compress the size of this page by joining all content streams and
applying a FlateDecode filter.
The text was updated successfully, but these errors were encountered: