Compressing a PDF File
Explore how to develop a Python command-line tool for compressing PDF files. Understand lossless and lossy compression types, implement PDFTron library functions, and measure file size reduction to optimize PDF storage and sharing.
We'll cover the following...
Introduction
PDF compression involves optimizing the document structure by shrinking its pictures, graphics, and objects, while maintaining its quality to a certain extent.
The primary reason for compressing a PDF file is to decrease its size in order to optimize its storage, and to improve its transfer via email or other online communication channels. This is mainly done for files that have size constraints related to email attachments, or to the data transferred via messenger applications.
What are PDF compression types
The PDF support two types of compression:
-
Lossy: This type of compression ...