{
  "id": 15856671,
  "title": "Why PDF compression quietly turns your text into a picture",
  "url": "https://urgent.news/2026/10/21/why-pdf-compression-quietly-turns-your-text-into-a-picture",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-21T07:16:14.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/funkyzx26/why-pdf-compression-quietly-turns-your-text-into-a-picture-4e36"
  },
  "original_language": "en",
  "account": "PDF compression can silently transform text into a picture without the user noticing. A 6-page text PDF can shrink from 298.7 KB to just 8.9 KB while preserving all 26,652 selectable characters. There are two main methods to reduce PDF size: converting it to an image or optimizing the file without turning it into an image. However, the former method always works, even on scanned documents, but it converts the document into a photograph of words. The latter approach preserves the text by collapsing duplicated objects, compressing content streams, and leaving the pages unchanged. This method often results in a much smaller file where the text remains readable, as demonstrated by a specific document where lossless repacking reduced it to 3.4 times smaller than the best raster result, maintaining complete text extractability. The reason rasterizing text in a PDF turns it into a picture lies in the document's structure. A PDF page is essentially a list of drawing operations, and text is represented by fonts and glyph positions, which can be selected, searched, copied, indexed, or parsed by various tools. When rasterized, the text is replaced with a bitmap, eliminating glyph positions and rendering it unusable for tasks requiring text manipulation. This process is largely silent, and its effects may only surface weeks later when the document fails to compress properly, leading to requests for a fresh copy. The issue arises when a text document has already been compressed, repacked, and saved multiple times, leaving its text streams uncompressed. A simple fix involves iterating through every indirect object in the document, identifying raw streams without a /Filter, deflating them, and encoding them with FlateDecode, ensuring that the compressed size is smaller than the original. This process can be implemented in about twenty lines of code, making it practical to ship and implement.",
  "summary": "A 6-page text PDF went from 298.7 KB to 8.9 KB with every one of its 26,652 characters still selectable. The usual way to shrink a PDF gets to 30.5 KB and zero. There are two ways to make a PDF smaller. Only one of them keeps the document a document. The common way is to render every page to an image and rebuild the file from those images. It always works, it works on scanned documents, and it is…",
  "key_points": [
    "PDF compression can covert text into a picture without user notice",
    "Two methods exist: image conversion or optimizing without turning into image",
    "Rasterizing text makes it unusable for text manipulation tasks"
  ],
  "editors_take": "Choosing rasterization over lossless optimization sacrifices text searchability and extractability for file size, creating hidden functional failures that only emerge when users attempt to manipulate the document later.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}