How to Compress a PDF

Compression a PDF file

It is important to make sure that your PDF is compressible. Whilst it is tempting to jump straight to a high compression setting if your portal says it is too large, understanding what type of content you have will help you pick the right compression method. You can always pop this tool open and test it using a small example.

For example, using Clean-up (Lossless – Text) on a 3 page test PDF (with each page having a heading, 2 short lines of printed text and a note saying what page it was from in the source). We saw that the source file size was 23,812 bytes. After downloading it the file size was reduced to 21,848 bytes. This was still 3 pages. Extracting the text from all pages of the output we saw that all 3 pages matched up with the source.

This gives an example of how little the file size was reduced. The summary shows “23KB to 21KB (8% less) Lossless”. Whilst this doesn’t show a dramatic percentage decrease, it does show you how much you can achieve. The difference between the sizes was 1964 bytes. How much you will see will depend on what is in your PDF. If your PDF is already quite small there may not be much you can remove.

Using the initial compression tool

Select a Mode

What do you need the file for? Are you just under the upload limit? Do you need a much smaller file for a slow connection? Does the recipient need to be able to select text, have easily readable diagrams and interactive form fields?

Make sure that you have a copy of the original file. This way you can check that the text, amount of pages and appearance are correct. If you are using an aggressive setting and it isn’t suitable you can go back to the source file.

Before you add your source file to the tool make sure that you can open it in a PDF reader. Check that it is the correct version you want to compress and that it opens without issues. Take note of how many pages it has and what the file size is. If the source file is already damaged or incomplete then you won’t be able to rely on compression to help.

Our test file was deliberately kept simple and didn’t contain any personal information. This shows you one way you can clean up your file. This doesn’t show you how all scanned books, complex forms, attachments and signed documents will behave. However, if your document has these features make sure you check they are present.

Performing a conservative clean-up

Click ‘Add files’ and select your PDF. In our example we had a file called study-packet.pdf which was 23KB. Make sure that it is the correct file name. If you have multiple very similar versions of your file it is easy to accidentally select an old draft by quickly scanning through.

We kept the Mode as Clean-up (Lossless – Text). This was the only compression mode used in this example. There is a more aggressive option which can be seen in the page description (rebuilds pages). This wasn’t used in this example. Don’t assume that a conservative clean-up will show you that all aggressive options will keep the same features.

Your source file (study-packet.pdf) has been selected in the Mode (Clean-up). Now click ‘Compress PDF’. Whilst the test was running the buttons were greyed out. When it had finished it told us how big the file was before and after compression (rounded). It gave us a download option called study-packet-compressed.pdf which was 21KB. We saved this.

Our output file had a size of 21,848 bytes, whereas our source was 23,812 bytes. Both had 3 pages and the text on each page matched up. This means that whilst we have a small reduction in file size we haven’t lost a page or changed any text. However, we can’t be sure that all features within a PDF will be kept. Our test fixture didn’t have a complex form, signature or bookmark tree.

If your destination has a strict file size limit then make sure you use the exact file size. Whilst the rounded file size helps you quickly see how big it is, if you are close to the limit it can be misleading. Also make sure that the destination is using bytes, kilobytes or megabytes.

When saving your compressed file make sure you have a clear name. Using a suffix like -compressed can help you to identify which version is which. If you create multiple versions make sure that you add a meaningful setting name or place them in separate folders. Otherwise you could accidentally compare the wrong outputs and think that a certain setting performed better.

Whilst described as a local browser tool, this test shows that we can see the process and that the output file has the correct size, page count and extracted text. This isn’t a privacy audit or offline test. Our test file didn’t have any sensitive information.

Checking the readability

Once you have compressed your file open it and compare it to your original. Scroll through all the pages. Check the small text, page borders, charts and any important images. Whilst reducing the file size is useful, the file also needs to be readable for the recipient.

If having selectable text is important try selecting some text or searching for a unique sentence. As we have seen in our structural comparison all 3 pages had matching text. This shows that using the clean-up mode is useful for this simple text based packet. For another document make sure you test the features you require.

If there are forms, links, comments or bookmarks in your source file make sure they are there. If the file has already been digitally signed follow the approved process by the document owner. This tutorial doesn’t claim that a digital signature will remain valid after compression. It is easy to forget that a file size task can have consequences if there are extra features in the document.

How much was reduced?

This could just be because your source file was already quite efficient. In our example we only reduced the file by around 8%. Don’t expect to be able to compress your file endlessly by using the same clean-up on your output. Firstly compare your output to what you actually required. If your file is now small enough and readable then you may have completed your task.

If it is still too large you may need a different method. Scanned documents may behave differently to short text based PDFs. Whilst there is a more aggressive option on the page, this is a compromise. Make sure you read the description and test a copy. If you are using a rebuild process make sure that you can select text and the images are clear. This wasn’t tested in this guide and wouldn’t have the same results as our clean-up.

Don’t lose any useful pages just to fit the file size. If the recipient only requires an excerpt then this is fine. However, extracting pages and compressing are two different tasks. If you have a shorter document it may be smaller but not meet the requirements of your task/application. Converting pages to low resolution images may make the file smaller but reduce how useful the content is.

Keeping a concise summary

When comparing your files make sure you have a note of the original file name, Mode used, original byte size, downloaded byte size and page count. This doesn’t need to be a formal report, just a few lines in your notes to make sure you don’t get confused with another version.

If the recipient is happy with a maximum file size then compare your downloaded file to this. If your file was only slightly over the limit then a small reduction in size will be perfectly fine. However, if the percentage looks impressive but the scan is still large then this won’t help.

Keep your test simple. Use one source file (which isn’t sensitive), one setting and one clearly named output. If you change your source and setting it may be harder to explain why your output has changed. Once you have a suitable output keep your checked copy and source together until you have delivered it. These are just suggestions for your workflow and aren’t extra features we have tested in the converter.

In practice you want to have a saved file which meets the file size requirements, opens without issues, has the correct amount of pages and is readable. In our example we reduced the byte size using clean-up and all the pages had matching extracted text. Try using this tool and start with the conservative setting. Compare your downloaded file to the source file.