<?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: Areeba Samar</title>
    <description>The latest articles on DEV Community by Areeba Samar (@areeba_samar_003ef6c12fef).</description>
    <link>https://dev.to/areeba_samar_003ef6c12fef</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4265451%2F4e04f05b-4faa-4829-bb78-342d4506743e.gif</url>
      <title>DEV Community: Areeba Samar</title>
      <link>https://dev.to/areeba_samar_003ef6c12fef</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/areeba_samar_003ef6c12fef"/>
    <language>en</language>
    <item>
      <title>How I Built 33 Image &amp; PDF Tools That Run 100% Client-Side with Zero Backend Costs</title>
      <dc:creator>Areeba Samar</dc:creator>
      <pubDate>Thu, 26 Nov 2026 07:45:09 +0000</pubDate>
      <link>https://dev.to/areeba_samar_003ef6c12fef/how-i-built-33-image-pdf-tools-that-run-100-client-side-with-zero-backend-costs-4km7</link>
      <guid>https://dev.to/areeba_samar_003ef6c12fef/how-i-built-33-image-pdf-tools-that-run-100-client-side-with-zero-backend-costs-4km7</guid>
      <description>&lt;p&gt;Most online PDF and image converter sites follow the same business model: upload user files to a cloud server, pay for compute, and then lock basic actions behind "2 free tasks per day" paywalls or watermarks.&lt;/p&gt;

&lt;p&gt;When I built &lt;a href="https://pandatooldesk.com" rel="noopener noreferrer"&gt;PandaToolDesk&lt;/a&gt;, I wanted to see how far modern browser APIs can go with &lt;strong&gt;zero backend servers, zero file uploads, and $0/month hosting&lt;/strong&gt; on Cloudflare Pages.&lt;/p&gt;

&lt;p&gt;Here is the architecture behind 33 browser-based tools — and the real performance trade-offs I ran into along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Choosing the Right Client-Side Libraries
&lt;/h2&gt;

&lt;p&gt;Modern browsers already ship with surprisingly powerful primitives, and pairing them with focused open-source JS/WASM libraries covers almost every everyday document task:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Image Compression, Target-KB Auto-Fitting &amp;amp; Conversion:&lt;/strong&gt; Native HTML5 Canvas 2D API handles JPG, PNG, and WebP re-encoding, SVG-to-PNG rasterization, white-background flattening for transparent PNGs, and pixel-level color extraction. For strict upload caps like &lt;a href="https://pandatooldesk.com/compress-image-to-100kb/" rel="noopener noreferrer"&gt;compressing an image to 100 KB&lt;/a&gt;, a lightweight binary-search quality solver combined with progressive downscaling finds the sharpest image that fits under the target byte budget.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interactive Cropping &amp;amp; Print Sheets:&lt;/strong&gt; &lt;code&gt;Cropper.js&lt;/code&gt; handles aspect-ratio cropping and 300 DPI passport print sheets cleanly across desktop and mobile touchscreens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HEIC Decoding:&lt;/strong&gt; Apple's HEIC format still trips up Windows and web upload portals. &lt;code&gt;heic2any&lt;/code&gt; decodes HEIC/HEIF blobs locally in the browser.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PDF Manipulation &amp;amp; Compression:&lt;/strong&gt; &lt;code&gt;pdf-lib&lt;/code&gt; handles merging, splitting, deleting/reordering pages, vector page numbers, text watermarks, and embedding signatures, while Mozilla's &lt;code&gt;PDF.js&lt;/code&gt; renders crisp page thumbnails, exports PDF pages up to 300 DPI images, and powers local &lt;a href="https://pandatooldesk.com/compress-pdf/" rel="noopener noreferrer"&gt;PDF compression&lt;/a&gt; for scanned or photo-heavy documents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OCR in the Browser:&lt;/strong&gt; &lt;code&gt;Tesseract.js&lt;/code&gt; runs optical character recognition inside a Web Worker using WebAssembly across 15 languages — only fetching the selected language dictionary once.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;QR Codes &amp;amp; Favicons:&lt;/strong&gt; &lt;code&gt;qrcode.js&lt;/code&gt; generates crisp vector SVGs and PNGs, &lt;code&gt;jsQR&lt;/code&gt; decodes live camera feeds or screenshots, and a small binary &lt;code&gt;DataView&lt;/code&gt; encoder packs multi-size PNGs into a valid &lt;code&gt;favicon.ico&lt;/code&gt; + &lt;code&gt;site.webmanifest&lt;/code&gt; ZIP.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. The Performance Trap: Heavy Vendor Bundles
&lt;/h2&gt;

&lt;p&gt;Client-side utilities come with one big performance hazard: libraries like &lt;code&gt;heic2any.min.js&lt;/code&gt; (1.3 MB), &lt;code&gt;pdf-lib.min.js&lt;/code&gt; (512 KB), and &lt;code&gt;pdf.min.js&lt;/code&gt; (312 KB) will wreck mobile PageSpeed Insights scores if you include them as blocking &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tags on page load.&lt;/p&gt;

&lt;p&gt;The fix that worked best for us was &lt;strong&gt;two-stage lazy loading&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Every page script loads with &lt;code&gt;defer&lt;/code&gt;, and heavy vendor libraries are declared in a &lt;code&gt;data-libs&lt;/code&gt; attribute on the tool container instead of &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tags.&lt;/li&gt;
&lt;li&gt;On the first &lt;code&gt;pointerenter&lt;/code&gt;, &lt;code&gt;touchstart&lt;/code&gt;, or &lt;code&gt;focusin&lt;/code&gt; event inside the tool box, a deduplicated loader silently preloads the required vendor scripts. While the user spends 2–3 seconds picking a file from their OS file picker, the libraries finish downloading in the background — keeping initial page load near-instant while feeling zero-latency when processing begins.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  3. Watching Out for Mobile Memory Leaks
&lt;/h2&gt;

&lt;p&gt;When processing batches of 12 MP phone photos or 100-page PDFs inside browser RAM, small leaks crash iOS Safari fast:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Revoke Blob URLs immediately:&lt;/strong&gt; Every &lt;code&gt;URL.createObjectURL()&lt;/code&gt; call for thumbnails or canvas loading must call &lt;code&gt;URL.revokeObjectURL()&lt;/code&gt; on &lt;code&gt;onload&lt;/code&gt;/&lt;code&gt;onerror&lt;/code&gt; (except when passed to &lt;code&gt;Cropper.js&lt;/code&gt;, which re-reads the source URL and must be revoked on reset or next image).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Destroy PDF.js document instances:&lt;/strong&gt; When a user switches to a different PDF, explicitly call &lt;code&gt;pdf.destroy()&lt;/code&gt; and cancel any background thumbnail rendering loop using a generation counter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shrink temporary canvases:&lt;/strong&gt; When converting multi-page PDFs to JPG/PNG at 300 DPI or compressing pages, reset &lt;code&gt;canvas.width = canvas.height = 1&lt;/code&gt; right after &lt;code&gt;toBlob()&lt;/code&gt; so mobile browsers reclaim GPU backing stores promptly.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Verifiable Privacy by Architecture
&lt;/h2&gt;

&lt;p&gt;Users are rightly skeptical when random converter sites claim "your files are safe." Because a client-side site has no upload endpoint at all, anyone can verify the claim in 30 seconds: open DevTools → Network tab, run a file through &lt;a href="https://pandatooldesk.com/merge-pdf/" rel="noopener noreferrer"&gt;Merge PDF&lt;/a&gt; or &lt;a href="https://pandatooldesk.com/compress-image/" rel="noopener noreferrer"&gt;Image Compressor&lt;/a&gt;, and observe zero bytes leaving the browser.&lt;/p&gt;

&lt;p&gt;We also documented a transparent breakdown of &lt;a href="https://pandatooldesk.com/blog/client-side-vs-cloud-file-tools/" rel="noopener noreferrer"&gt;client-side vs. cloud file tools&lt;/a&gt; — including the tasks that still genuinely require a backend server (like reconstructing complex PDF layouts back into &lt;code&gt;.docx&lt;/code&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;If you're building utility web apps in 2026, skipping the backend wherever the browser can handle the workload cuts hosting costs to zero, eliminates data-retention liability, and gives users faster results. Feel free to inspect &lt;a href="https://pandatooldesk.com" rel="noopener noreferrer"&gt;PandaToolDesk&lt;/a&gt; in DevTools and let me know if you spot any edge cases!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>performance</category>
      <category>javascript</category>
      <category>privacy</category>
    </item>
  </channel>
</rss>
