<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Irshad Malik</title>
    <description>The latest articles on DEV Community by Irshad Malik (@irshad_malik_422e679173d7).</description>
    <link>https://dev.to/irshad_malik_422e679173d7</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4250489%2F93895f19-8a91-484b-a271-8e4f4de8be42.png</url>
      <title>DEV Community: Irshad Malik</title>
      <link>https://dev.to/irshad_malik_422e679173d7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/irshad_malik_422e679173d7"/>
    <language>en</language>
    <item>
      <title>Shrink a PDF to Exactly the Size You Need — Without Uploading It Anywhere</title>
      <dc:creator>Irshad Malik</dc:creator>
      <pubDate>Tue, 17 Nov 2026 19:31:24 +0000</pubDate>
      <link>https://dev.to/irshad_malik_422e679173d7/shrink-a-pdf-to-exactly-the-size-you-need-without-uploading-it-anywhere-42eh</link>
      <guid>https://dev.to/irshad_malik_422e679173d7/shrink-a-pdf-to-exactly-the-size-you-need-without-uploading-it-anywhere-42eh</guid>
      <description>&lt;p&gt;Most PDF compressors ask you to pick "low / medium / high" and hope. Here's a client-side approach that starts at the highest quality and steps down only until the file fits — and your document never leaves your device.&lt;/p&gt;

&lt;h3&gt;
  
  
  The problem with "pick a quality level"
&lt;/h3&gt;

&lt;p&gt;Every upload portal phrases its limit as a number, not a vibe: "PDF, maximum 2 MB." An email bounces at 5 MB. A government form insists on 200 KB. Yet most free PDF compressors make you guess a quality preset — Low, Medium, High — and then tell you afterwards whether the result happened to fit. If it didn't, you compress again, a little blinder each time.&lt;/p&gt;

&lt;p&gt;The better question is the one the portal actually asks: &lt;strong&gt;how small does this file need to be?&lt;/strong&gt; Answer that number, and the tool should do the guessing for you.&lt;/p&gt;

&lt;h3&gt;
  
  
  Target-size compression, step by step
&lt;/h3&gt;

&lt;p&gt;The approach is simple, and it is exactly what ToolRush's free Compress PDF tool does in the browser:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Pick your target size&lt;/strong&gt; — 200 KB, 500 KB, 1 MB, 2 MB (the default), or 5 MB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Drop in your PDF.&lt;/strong&gt; The tool shows its name, size, and page count.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It tries the highest quality first&lt;/strong&gt; — Print quality at 300 dpi — and checks whether the result fits your target. If it does, it stops there. If not, it steps down: 150 dpi, then 120, 96, and 72 dpi, finishing with a 72 dpi grayscale pass.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You get the highest quality that still fits&lt;/strong&gt;, with a result panel showing the original size, the compressed size, the percentage saved, and which setting was used.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The key detail: most of a PDF's weight is not its text. It's the photos and scans embedded in it, often stored at far higher resolution than any screen or office printer can use. Compression re-encodes those images at a sensible resolution while the text and line art stay in their original vector form — perfectly sharp at every setting. So stepping down image resolution is a controlled trade, not a blur-everything gamble.&lt;/p&gt;

&lt;h3&gt;
  
  
  A real example
&lt;/h3&gt;

&lt;p&gt;Take a three-page scanned document — three full-page colour images at 300 dpi — weighing 6.8 MB, headed for a portal that accepts at most 2 MB. With the 2 MB target selected, the tool first tries Print quality (300 dpi): the file barely changes, because the images are already stored efficiently at that resolution. It steps down to Balanced (150 dpi). That fits: the compressed PDF is 362 KB — a 94.8% reduction, comfortably under the limit — and the tool stops there instead of degrading the file further, because Balanced is the highest quality that fits. Page count and text are unchanged; only the embedded images are now stored at 150 dpi instead of 300, still clear for reading on screen.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why it runs in your browser (and why that matters)
&lt;/h3&gt;

&lt;p&gt;This is the part that makes the tool interesting from a technical angle. The compression engine is &lt;strong&gt;Ghostscript&lt;/strong&gt; — the open-source engine professional PDF tools are built on — compiled to WebAssembly so it runs inside the browser. The first time you compress, your browser downloads the engine (about 16 MB, served from toolrush.org itself, no third-party server involved). After that it's cached, and repeat compressions start quickly.&lt;/p&gt;

&lt;p&gt;Your document itself never travels over the internet. That's not a marketing line; it's an architectural fact — there is no server endpoint receiving your file, because the work happens on your own device. For scanned contracts, ID documents, and certificates, that distinction is the whole point: the files people most need to shrink are exactly the ones they least want to upload to a stranger's server.&lt;/p&gt;

&lt;p&gt;A few honest limits, straight from the tool's own FAQ:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A very small target isn't always reachable.&lt;/strong&gt; A long document of dense, detailed scans has a hard floor — the tool says so plainly and offers the smallest result it achieved, instead of pretending it hit the target.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Some PDFs are already well optimized.&lt;/strong&gt; Files exported by Microsoft Office or a modern scanner app often have little left to squeeze. The tool tells you the file was already well optimized and offers your original back, rather than handing you a larger file dressed up as a success.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Password-protected PDFs are detected&lt;/strong&gt; and reported, not silently failed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;There's no built-in file-size limit&lt;/strong&gt; — the practical limit is your device's memory. Files of a few dozen megabytes usually compress fine on a laptop or a recent phone.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  When to reach for it
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Application and government portals with strict upload caps (200 KB to 2 MB are typical).&lt;/li&gt;
&lt;li&gt;Email attachments that bounce against 5 MB or 10 MB mailbox limits.&lt;/li&gt;
&lt;li&gt;Scanned contracts, ID documents, and certificates that come off a scanner at 10 MB or more.&lt;/li&gt;
&lt;li&gt;Reports and ebooks that need to open quickly on phones and slow connections.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the target you need is a number, start from the number. Try it free, no sign-up, nothing uploaded: &lt;a href="https://toolrush.org/tools/compress-pdf" rel="noopener noreferrer"&gt;https://toolrush.org/tools/compress-pdf&lt;/a&gt;&lt;/p&gt;

</description>
      <category>pdf</category>
      <category>webassembly</category>
      <category>webdev</category>
      <category>privacy</category>
    </item>
  </channel>
</rss>
