Compress PDF files
Welcome to the Compress PDF guide. This guide will teach you how to Compress one or more PDF files easily.
Remember that all Tool Guides takes into account that you have previous knowledge about the Basics to process a PDF with our REST API. We strongly recommend you to read the related guide before start with this one.
You may have seen how compress works in previous guides, it is very easy as you will see in this code:
You can add as much files as you want to compress and simply choose the compress tool to process.
However you can choose 3 levels of compression which by default will be set as the recommended level of mixed compression and quality loss.
Simply add the function setCompressionLevel() with your desired level of compression like this:
These are the following levels to choose:
- setCompressionLevel('low') Minor compression to gain some Kb without quality loose
- setCompressionLevel('recommended') Recommended is a good mix of compression and quality standards for your PDF files
- setCompressionLevel('extreme') High compression levels. Not recommended for PDFs where images and pictures are important
The REST API will try to compress all your files at its maximum.