Developer & Network Tools

Compressing and Merging PDFs Safely

Shrink and combine PDF files without ruining quality, losing signatures or handing private documents to the wrong service.

Key takeaways

  • Large PDFs usually contain high-resolution scans or photos, and reducing image resolution gives the biggest savings.
  • Work on copies, because lossy compression cannot be undone.
  • Merging or rewriting a digitally signed PDF will generally break or discard the signature.
  • For private documents, prefer a tool that processes files on your own device, and verify that it really does.
  • Drawing a black box over text is not redaction, since the text underneath can remain in the file.

To shrink a PDF, you mostly shrink the images inside it. To merge PDFs, you copy their pages into one new file. Both are easy, and both can quietly damage a document: blurry scans, broken signatures, lost form fields or hidden information carried along.

The safe routine is to keep your originals, choose a tool that matches how sensitive the document is, and inspect the result before you send it. This guide explains what makes PDFs large and how to handle each job.

What is inside a PDF

PDF is a page description format, standardized as ISO 32000. A file is a collection of objects: text with positioning instructions, vector shapes, embedded fonts, images, links, form fields, annotations, attachments and metadata.

Text is tiny. A long report made of real text and a few fonts is often small. A scan is different: each page is one big picture, so a short scanned contract can be many times larger than a long typed manual.

Other sources of bulk include photographs placed at full camera resolution, several complete font files, leftover objects from repeated edits and files attached inside the document. PDF allows changes to be appended to the end of a file, which means earlier content may linger after editing.

What a PDF file can carry
PDF document A set of objects that make up pages Signatures Tie approval to exact bytes Metadata Author, software and dates Comments Notes that may be overlooked Text and fonts Usually small and searchable Images Often the bulk of the size Forms and links Interactive fields and targets PDF document A set of objects that make up pages Text and fonts Usually small and searchable Images Often the bulk of the size Forms and links Interactive fields and targets Comments Notes that may be overlooked Metadata Author, software and dates Signatures Tie approval to exact bytes

Choose where the processing happens

You have three broad choices.

Software installed on your computer. Preview on macOS, desktop PDF editors, office suites and open source utilities keep files local.

Tools that run in your browser. Some web tools download their code and then process your file on your device. Others upload it. The page looks the same either way. Local browser tools explains how to check.

Online services that upload files. They can be convenient and capable. You are trusting the operator with the contents, its retention policy and its security.

Match the choice to the document. A public flyer can go almost anywhere. Tax returns, medical records, identity documents, contracts and anything covered by a work policy should stay on equipment you or your organization controls. Our PDF compressor and PDF merger pages say how each handles your file; read that before loading something sensitive.

Where should this PDF be processed?
Covered by a work or legal rule? YES Use only tools your organization approves 1 NO Holds ID, money or health details? YES Keep it on your own device with local software 2 NO Is it already public? YES Any reputable tool is reasonable 3 NO Default to local If unsure, avoid uploading it Covered by a work or legal rule? 1 IF YES Use only tools your organization approves NO Holds ID, money or health details? 2 IF YES Keep it on your own device with local software NO Is it already public? 3 IF YES Any reputable tool is reasonable NO Default to local If unsure, avoid uploading it

Compress without wrecking the document

Start at the source if you can. Exporting again from the original word processor file with a "smaller file" or "web" quality option usually beats compressing the finished PDF.

For scans, three settings matter:

  • Resolution. Around 300 dots per inch is a common choice for text you may print or run through character recognition. Around 150 is often readable on screen. Check small print before going lower.
  • Color. A black text page scanned in grayscale is much smaller than in full color. Pure black and white is smaller still but can lose faint stamps and signatures.
  • Compression. JPEG-style compression suits photos; at strong settings it smears the edges of letters.

On macOS, Preview offers a "Reduce File Size" filter when exporting. It can be aggressive, so view the output at full size. With Ghostscript installed, a command like this recompresses a file:

gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH -sOutputFile=smaller.pdf original.pdf

On Windows the program is typically named gswin64c. The /screen preset is smaller and rougher, while /printer keeps more detail. Rewriting this way can change or drop interactive features, so compare the result with the original.

Some files barely shrink, or grow. If the images are already well compressed, or there are none, there's little to gain. Consider sharing a link instead, since email attachment limits are often the real problem.

Hit a size limit

Upload portals often set a maximum size, and it's tempting to apply the strongest setting until the file fits. Work down gradually instead.

  1. Remove pages nobody asked for, such as blank backs of scanned sheets or a duplicate cover.
  2. Check for attachments inside the file and take out any that aren't needed.
  3. Recompress at a moderate setting and look at the result.
  4. If a scan is still too big, rescan in grayscale at a sensible resolution. This usually looks far better than squeezing a large color scan very hard.
  5. As a last step, split the document into numbered parts, if the recipient accepts that.

Say a six-page application is too large because each page is a color phone photo. Using a scanning app that crops to the page edge, flattens lighting and saves in grayscale gets you a smaller and more readable file than compressing the original photos. Image preparation follows the same logic: fix the dimensions and the content first, then adjust compression.

Zipping a PDF rarely helps much, since the images and most streams inside are already compressed.

Merge files cleanly

Merging copies pages from several documents into a new one. Before you start, rename files with leading numbers so they sort as intended, and rotate any sideways scans.

On macOS, open a PDF in Preview, show the thumbnails sidebar and drag pages from another document into it. Work on a duplicate, because Preview can save changes automatically. With the open source tool qpdf:

qpdf --empty --pages cover.pdf report.pdf appendix.pdf -- combined.pdf

The same tool can pull out a range:

qpdf report.pdf --pages . 1-3 -- first-three.pdf

After merging, check the page count and order. Click through internal links and bookmarks, which some tools drop. Fillable forms with fields of the same name can start sharing values once combined; saving a flattened copy of each completed form first avoids that.

Signatures, passwords and accessibility

A digital signature is calculated over the file's bytes. Compressing rewrites them, and merging puts the pages into a different document. The signature will show as invalid or disappear. Send signed files separately and unaltered, and ask the signers if you need a combined signed version. See how digital signatures work.

Password-protected PDFs must be opened with the password before they can be processed. Only remove protection from documents you're entitled to change. If you re-protect the result, send the password through a different channel from the file.

Tagged PDFs include structure that screen readers use: headings, reading order and image descriptions. Some compressors and mergers strip it. If your audience includes assistive technology users, or you have accessibility duties, check the output with an accessibility checker.

Scans have no text at all until character recognition adds a layer. Run it before heavy downsampling, and proofread important numbers.

Clean out what you don't mean to share

Merged files inherit things you may not notice: comments, tracked review notes, attachments, hidden layers and metadata such as author names.

Redaction needs a real redaction feature that deletes the underlying content. Covering text with a black rectangle, highlighting it in black or cropping the page only changes what's displayed. After redacting, search the saved file for a removed word, try selecting text in the area and check the document properties. The same caution about hidden data applies to metadata in photos.

Treat PDFs you receive with some care too. They can contain links and active content, so keep your reader updated and don't enable features a strange document asks for.

A final inspection

Before sending, open the new file and:

  1. Compare the page count with the sources.
  2. Zoom to 100% or more on small print, tables and signatures.
  3. Search for a word to confirm text is still searchable.
  4. Check links, bookmarks and form fields.
  5. Review the document properties and comments panel.
  6. Confirm the file name says what it is.

Keep the originals until the recipient has confirmed the copy is usable, and longer for anything you may need as a record.

Archiving the result

For records you need to open many years from now, ask whether the recipient requires PDF/A, an archival variant of the format standardized as ISO 19005. It requires fonts to be embedded and rules out features that depend on outside resources, along with encryption. Courts, government offices and libraries sometimes specify it.

Aggressive optimization can strip the very things an archival copy needs, so convert to the archival form as the final step and validate it with a suitable checker. If you want to be able to show later that a stored file is unchanged, record its hash, as explained in file verification. And keep at least one backup somewhere separate from your computer.

Common questions

Why did my file get bigger after merging?

Each source may carry its own copy of the same fonts and images, and some tools don't share them. A careful optimization pass afterward can help.

Can I restore quality after compressing too much?

No. Discarded image detail is gone. Go back to the original and use gentler settings.

Written for 4Internet with AI writing tools and not reviewed line by line by a person. Check anything you rely on with the maker, provider or standard concerned. Report an error.

Keep reading

All 45 articles in Developer & Network Tools →

Latest news on this topic