Content Management

How to Compress PDFs in Stirling PDF: Quality vs File Size

J
James Eriksson
··13 min read
Compress PDFs in Stirling PDF using quality sliders or file-size targets. Grayscale and line-art save 20-80%. Run OCR first. No per-file fees.
TL;DR
  • Stirling PDF compresses using the same Ghostscript engine as SmallPDF, with options for a quality slider (1-9) or file-size target
  • Grayscale and line-art conversion save the most space (20-80% depending on content), but sacrifice color and image detail
  • Run OCR before compression to keep PDFs searchable; compress scans and archives sequentially to avoid memory issues on files over 150MB
  • Self-hosted compression keeps files on your server and costs nothing per file, but requires you to manage the server and updates

Stirling PDF compression keeps your files on your server and out of third-party clouds. You choose between a quality slider (1-9) or a target file size, then run the compression. This guide walks you through every option so you understand the trade-offs and when this tool actually fits your workflow.

Why Compress PDFs, and When Stirling PDF Is Right

Files pile up. A year of invoices, contracts, and scans bloats your storage and slows email attachments. Online tools like SmallPDF or iLovePDF can compress in seconds, but they upload your files to their servers. If you handle confidential documents, that is a dealbreaker.

Stirling PDF runs on your hardware. Files never leave your network. You get comparable compression (via Ghostscript, the same engine many commercial tools use) and full control over quality vs size trade-offs.

Stirling PDF compression works best for:

  • Archival PDFs (invoices, receipts, contracts you need to keep but rarely touch)
  • Scanned documents (utility bills, insurance forms, tax records)
  • Presentation PDFs with embedded images
  • Batches of documents you want to email or upload to a file server

This tool is not the right choice if you:

  • Need to compress fillable forms or PDFs with interactive fields (compression can break them)
  • Are compressing photographs or fine-art PDFs (you will lose image detail)
  • Need a mobile or cloud UI (Stirling runs only on a server you operate)
  • Require batch automation without touching the web interface (see the Reddit notes below on alternatives)

Compression Methods: Quality Slider vs File Size Target

Stirling PDF offers two fundamentally different ways to compress. Understanding which one fits your situation is the first decision.

The Quality Slider (1-9) is the simpler choice. You move a slider from 1 (smallest file, worst quality) to 9 (largest file, best quality), then click compress. The default is 5. The tool applies a fixed compression profile based on your choice: Ghostscript downsamples images, removes redundant data, and re-encodes the PDF. The final file size is not predictable--a 50MB invoice PDF might shrink to 8MB at quality 5, but a 50MB photograph PDF might only hit 15MB.

Use the quality slider if you do not care about hitting a specific file size. It is fast and requires no math. Start at 5, compress a test file, and check the result. If it looks good, run the same quality on your batch. If the file is still too large, drop to 4. If quality suffers (blurry text, missing details), bump to 6.

The File Size Target lets you say "I need this PDF to be 5MB or less" and Stirling tries to hit that. You enter a target in KB or MB, and the tool iteratively compresses until the file is close to your goal. This is useful if you have a constraint: your email server rejects attachments over 10MB, or you are uploading to a platform with a 25MB file limit.

The trade-off: file-size targeting is slower (the tool has to test, measure, and re-compress) and results vary. A scanned utility bill might hit your 2MB target cleanly. A PDF full of charts and screenshots might overshoot to 2.3MB because the tool cannot compress further without rendering it unreadable.

In practice: use the slider for most work. Use the file-size target when you have a hard constraint.

Compression Options Explained: What Each Setting Actually Does

Stirling PDF compression runs on Ghostscript, an open-source PDF engine. The official docs mention a few key options. Here is what each actually does:

Grayscale for Compression converts all colors to black and white. This saves space because color data takes up more bytes than monochrome. A color invoice PDF might shrink by 20-30% if you strip the colors. The loss: any colored highlighting, logos, or charts loses the color info. Text is still readable. Best for: text-heavy documents, old scans, internal forms where color does not matter. Skip it for: branded documents, invoices with color signatures, any file where color is information.

Linearize PDF for Web Viewing reorders the internal structure of the PDF so the first page loads before the entire file downloads. This helps when you are viewing a large PDF in a browser over slow internet. The file size does not change--you are just reorganizing bytes. The benefit is speed, not space. Use this if users will view your PDFs in a web viewer and you want faster page-load feedback. Skip it for: archive storage, email, any offline use.

Convert Images to Line Art tells Ghostscript to treat images as line drawings (black and white, no shades of gray). This is the heaviest compression option. A scanned document with mixed quality (some photos, some text) can shrink by 70-80%. The trade-off: photographs become unreadable. Detailed charts lose nuance. Text-only scans look clean. Best for: OCR input (you are about to digitize the text anyway), black-and-white document scans, diagrams. Skip it for: any file with photographs, signatures, or color information you want to preserve.

Detail Level and Edge Emphasis are tuning dials for Ghostscript's image processing. Turning these up increases file size (keeps more detail) but can sharpen edges on text. These are for advanced users. Leave them at defaults unless you are testing.

Step-by-Step: Compressing Your First PDF

Here is the workflow:

  1. Open Stirling PDF and navigate to the Compress tool.
  2. Click "Select File" and choose the PDF from your computer or Stirling's file browser.
  3. Choose your compression method:
    • Quality slider: drag to 5 (or test a value), or
    • File Size target: enter your target (e.g., "5 MB" or "2000 KB").
  4. (Optional) Enable options:
    • Grayscale for Compression: check if the document is color and you do not need the color.
    • Linearize PDF for Web Viewing: check only if the PDF will be viewed in a browser.
    • Convert Images to Line Art: check only for text-heavy scans or diagrams (not photos).
  5. Click "Compress."
  6. Stirling processes the file and shows a download link.
  7. Download and open the compressed PDF in your usual viewer. Check that text is readable, images are acceptable, and forms still work (if applicable).
  8. If the result is too compressed, re-upload and try quality 6 or quality 7. If it is still too large, then try grayscale.

Testing checklist:

  • Open the compressed file in PDF reader (not just the browser preview).
  • Scroll through a few pages and confirm text is readable.
  • If the PDF has forms, fill in a test field to verify forms are not broken.
  • If the PDF has signatures or colored annotations, check that they survived.
  • Compare file sizes: original vs compressed. A 50% reduction is typical for scans, 30-40% for text documents.

Pre-Compression: When to Run OCR, Redact, or Combine Operations

Compression is not always the first step. Sometimes you need to prepare the PDF first.

OCR Before Compression is the right order. OCR (optical character recognition) scans images of text in the PDF and adds an invisible text layer. This makes scanned documents searchable and copy-paste-able. Run OCR before compression because:

  • Compression can degrade image quality, making OCR less accurate if done after.
  • An OCR'd PDF is already smaller (the text layer is tiny), so compression works better.

Workflow: Upload PDF OCR Compress Download.

Redaction Before Compression matters for sensitive documents. If you need to black out social security numbers, medical info, or account numbers, redact first. Redaction permanently removes data. Compression after redaction is harmless--you are just shrinking an already-cleaned file.

Combining Operations is common. A received utility bill (scanned, color, not searchable): Upload Grayscale OCR Compress. Result: a black-and-white, searchable, tiny file.

Stirling PDF's web interface runs operations one at a time. If you need to batch-compress 100 files with OCR, consider scripting via Ghostscript directly (see alternatives below) or running multiple browser tabs in parallel.

Compression Ratios and Real-World Examples

Here are typical results. Your mileage varies by content:

Scanned Utility Bill (mixed quality, color, 3 pages, original 8.5 MB)

  • Quality slider 5: 2.1 MB (75% reduction)
  • Quality slider 7: 3.5 MB (59% reduction)
  • Grayscale + Quality 5: 1.4 MB (84% reduction)

Why: original has photos, colored headers, and low-res scanning artifacts. Grayscale strips colors. Quality 5 downsamples images aggressively.

High-Resolution Image PDF (12 photos, original 95 MB)

  • Quality slider 5: 18 MB (81% reduction)
  • Grayscale + Quality 3: 6.2 MB (93% reduction, but photos are grayscale and blurry)
  • Line Art: Fails (photographs do not convert to readable line art)

Why: photographs compress well because Ghostscript removes color and downsamples. Line art is wrong tool for photos.

Text-Heavy Invoice PDF (black and white, tables, signatures, original 2.2 MB)

  • Quality slider 5: 1.8 MB (18% reduction)
  • Quality slider 3: 1.6 MB (27% reduction)
  • Grayscale: No change (already monochrome)

Why: text documents have little redundant image data. Compression gains are small. File is already efficient.

The rule: scans with embedded photos compress best (60-85%). Text-only PDFs compress least (10-30%).

Memory, Stability, and Large Files

Reddit users report mixed results compressing PDFs larger than 150MB. Some handle them fine. Others see the Stirling PDF process consume all available RAM and crash.

The issue: Stirling PDF decompresses the entire PDF into memory, re-encodes it, then writes it back. A 500MB PDF might need 1-2GB of free RAM to compress. If your server has 4GB total and 3GB are in use, compression fails.

Mitigations:

  • Allocate RAM to Stirling PDF. If you are running Stirling in Docker, set a memory limit above your largest file. If you are compressing a 200MB PDF, give Stirling 500MB headroom: docker run -m 1g stirling-pdf.
  • Compress files sequentially, not in parallel. If you have 10 large PDFs, compress one at a time. Each gets full access to available memory.
  • Split large PDFs. A 600MB PDF split into two 300MB files each compresses faster and more reliably.
  • Use Ghostscript CLI for extreme batches. If you are compressing 100+ large PDFs regularly, shell script Ghostscript directly instead of clicking through the UI. It is not supported by Stirling, but it works. Example: gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -dPDFSETTINGS=/ebook -sOutputFile=out.pdf in.pdf.

Honest take: Stirling PDF compression is reliable for most files (under 50MB). For regular batches of large PDFs, consider a dedicated command-line tool or a commercial service.

Self-Hosted Compression vs Online Tools: The Privacy Win (and Trade-Offs)

Stirling PDF vs SmallPDF vs iLovePDF:

Stirling PDF (Self-Hosted)

  • Cost: free (you host it)
  • Privacy: files stay on your server
  • Quality: Ghostscript engine, comparable to commercial tools
  • Speed: depends on your server RAM and CPU
  • UI: web browser only; no mobile app
  • Support: community only; GitHub issues
  • Maintenance: you manage updates, backups, server resources

SmallPDF ($12-15/month or $6/month annual)

  • Cost: recurring subscription or per-file pay-as-you-go
  • Privacy: files uploaded to SmallPDF servers, deleted after 1 hour
  • Quality: proprietary engine, good compression
  • Speed: fast (commercial infrastructure)
  • UI: web and mobile apps
  • Support: email support included
  • Maintenance: none (SaaS)

iLovePDF ($6-10/month or free tier with limits)

  • Cost: freemium model or subscription
  • Privacy: same as SmallPDF; files uploaded and auto-deleted
  • Quality: similar to SmallPDF
  • Speed: fast
  • UI: web and mobile
  • Support: community forums
  • Maintenance: none (SaaS)

When Stirling PDF wins: You handle confidential documents, compliance requires files to stay on-premise, or you compress PDFs regularly enough that a one-time setup cost is worth it. A typical small firm (10-30 people) spends $60-150/year on SmallPDF or iLovePDF. If you compress even 10 PDFs a week, Stirling pays for itself in server resources in a year.

When online tools win: You compress PDFs occasionally, do not want to manage a server, or need mobile access. The $10-15/month is cheaper than your time learning Docker.

Stirling PDF is not a replacement for online tools--it is an alternative for different priorities. Run the hosted version on Opsily or your own VPS, and you get privacy, control, and no per-file or per-month costs.

Frequently Asked Questions

How do I compress a PDF in Stirling PDF?

Select your file in the Compress tool, choose a quality slider (1-9) or enter a target file size, optionally enable grayscale or line-art conversion, then click Compress. Download the result and verify it in your PDF reader.

What is the difference between Quality and File Size compression methods?

Quality is a slider: 1 is smallest (blurriest), 9 is largest (clearest). File Size lets you specify an exact target (e.g., "5 MB") and the tool tries to hit it. Quality is faster and simpler. File Size is useful when you have a hard constraint.

Should I run OCR before or after compression?

Before. OCR adds a searchable text layer. Compression after OCR works better because the text layer is tiny. If you compress first, image degradation can make OCR less accurate.

What compression options save the most space?

Convert Images to Line Art saves the most (70-80% for text-heavy scans) but only works for text and diagrams. Grayscale saves 20-30% and works for most files. Linearize PDF does not reduce file size; it speeds up browser viewing.

Why does Stirling PDF compression sometimes use all my memory or crash?

Stirling decompresses the entire PDF into RAM before re-encoding. Large PDFs (150MB+) need proportional memory. Mitigate by allocating more RAM to the container, compressing sequentially, splitting large files, or using Ghostscript CLI for batch work.

Can I compress multiple PDFs at once?

The web interface compresses one file at a time. The Stirling API and folder watching (available in some configurations) support batch operations, but they are not documented in the Compress tool guide. For regular batch work, use Ghostscript CLI or run multiple browser tabs in parallel.

Is Stirling PDF compression as good as SmallPDF or iLovePDF?

Yes, it uses the same Ghostscript engine. The difference is control and privacy, not compression quality. You run it on your server, so files stay yours.

What does Linearize PDF for Web Viewing do?

It reorders the PDF's internal structure so the first page loads before the entire file downloads (streaming). File size does not change. Use it only if users will view the PDF in a web browser and you want faster perceived load times.

The Bottom Line

Stirling PDF compression works well for archives, scans, and documents you need to store or email. The quality slider is simple: start at 5, test, and adjust. If you need a file size target, enter it. For scans, grayscale + quality 5 often cuts the file by 75%, which is enough for most workflows.

The trade-off is control: you do not get a mobile app or one-click online tool. You manage the server. But your files never leave your network, and you pay nothing per file. For teams handling confidential documents, that trade is worth it.

Most of your compression questions are answered by testing. Download a copy of a document you normally email, compress it at quality 5, and see what happens. If the result is good, you now have a template for your whole archive. If it is too aggressive, try quality 6 or quality 7. The whole process takes 10 minutes.

Ready to set up Stirling PDF? Opsily offers managed Stirling PDF hosting on EU servers, so you get privacy without the Docker learning curve.

Run Stirling PDF without the ops burden
Opsily hosts Stirling PDF on EU infrastructure with automatic backups and updates.
Get Started Free

Ready to self-host your own apps?

One server. Multiple apps. No per-app fees.

Get started →