<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[KuickKonvert Engineering]]></title><description><![CDATA[Technical notes from building KuickKonvert, a free online file converter: LibreOffice and Ghostscript tests, PDF compression presets and file handling.]]></description><link>https://kuickkonvert.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6afc93f6ee9372bb55def3a5/e320b2ba-6e88-420c-a3c0-6e8597831f67.png</url><title>KuickKonvert Engineering</title><link>https://kuickkonvert.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 18 Nov 2026 15:12:07 GMT</lastBuildDate><atom:link href="https://kuickkonvert.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[I ran three PDFs through Ghostscript's /screen, /ebook and /printer presets. Here's what happened to each.]]></title><description><![CDATA[Ghostscript's /screen, /ebook and /printer presets tested on a photo, a scan and a text PDF. /ebook beat /screen on the photo; /printer grew the text.]]></description><link>https://kuickkonvert.hashnode.dev/i-ran-three-pdfs-through-ghostscript-s-screen-ebook-and-printer-presets-here-s-what-happened-to-each</link><guid isPermaLink="true">https://kuickkonvert.hashnode.dev/i-ran-three-pdfs-through-ghostscript-s-screen-ebook-and-printer-presets-here-s-what-happened-to-each</guid><category><![CDATA[pdf]]></category><category><![CDATA[ghostscript]]></category><category><![CDATA[Python]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[Flask Framework]]></category><dc:creator><![CDATA[KuickKonvert]]></dc:creator><pubDate>Tue, 17 Nov 2026 19:30:57 GMT</pubDate><content:encoded><![CDATA[<p>If you've wired Ghostscript into a "compress PDF" feature, you've probably reached for <code>-dPDFSETTINGS</code>. I maintain a small open-source file converter (Flask, Ghostscript and LibreOffice; disclosure: it's my project, KuickKonvert). I wanted to know what the three common presets actually do to ordinary files, so I tested them and published the inputs, outputs and script.</p>
<h3>The command</h3>
<p>Ghostscript 10.02.1, the same options the converter uses:</p>
<pre><code>gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen \
   -dAutoRotatePages=/None -dNOPAUSE -dQUIET -dBATCH \
   -sOutputFile=out.pdf in.pdf
</code></pre>
<p><code>/ebook</code> and <code>/printer</code> were swapped in for <code>/screen</code>.</p>
<h3>The three inputs</h3>
<table>
<thead>
<tr>
<th>Input</th>
<th>Original</th>
<th>/screen</th>
<th>/ebook</th>
<th>/printer</th>
</tr>
</thead>
<tbody><tr>
<td>One 3000 × 2000 px photo placed at 300 dpi</td>
<td>1,096.3 KB</td>
<td>495.3 KB (45.2%)</td>
<td>58.3 KB (5.3%)</td>
<td>881.2 KB (80.4%)</td>
</tr>
<tr>
<td>One-page greyscale scan, A4 at 200 dpi</td>
<td>915.3 KB</td>
<td>138.0 KB (15.1%)</td>
<td>733.7 KB (80.2%)</td>
<td>736.3 KB (80.4%)</td>
</tr>
<tr>
<td>Five-page text-only PDF (standard Helvetica, not embedded)</td>
<td>5.6 KB</td>
<td>5.5 KB (99.0%)</td>
<td>5.5 KB (98.9%)</td>
<td>11.5 KB (206.5%)</td>
</tr>
</tbody></table>
<h3>Three things I didn't expect</h3>
<p><strong>1. /screen was not the smallest for the photo.</strong> /screen downsampled the photo to 720 × 480 px (72 dpi) but stored it with lossless Flate compression. /ebook kept 1500 × 1000 px (150 dpi) but used JPEG, and came out at 58 KB against 495 KB. The photo here is synthetic (generated noise with grain), so a real camera photo may behave differently, but it was enough to stop me assuming /screen always wins.</p>
<p><strong>2. The scan barely moved on /ebook and /printer.</strong> Only /screen made a real difference (15% of the original). At 200 dpi, the scan was already close to what the other two presets aim for.</p>
<p><strong>3. A text-only PDF can grow.</strong> /printer doubled the five-page text file. My guess is that it embedded the font, but I haven't confirmed that from the output file, so treat it as a guess.</p>
<h3>What I do in the app because of this</h3>
<p>After Ghostscript runs, the converter checks two things: that the output has the same number of pages as the input (Ghostscript can exit with code 0 and still write a blank one-page PDF for some damaged files), and that it is actually smaller. If it isn't smaller, the user gets their original file back. The size check, simplified:</p>
<pre><code class="language-python">import os, shutil

def keep_smaller(src, out):
    if os.path.getsize(out) &gt;= os.path.getsize(src):
        shutil.copyfile(src, out)  # compression didn't help: return the original
</code></pre>
<h3>Takeaways</h3>
<ul>
<li>Look at what is inside the PDF before compressing: images are where the weight is.</li>
<li>Don't assume the "lowest" preset gives the smallest file; test /ebook too.</li>
<li>Always compare the output with the input, and fall back to the original.</li>
</ul>
<h3>Reproduce it</h3>
<ul>
<li><strong>Files, results and the script that regenerates everything from fixed seeds</strong> (CC BY 4.0): <a href="https://doi.org/10.5281/zenodo.24199945">https://doi.org/10.5281/zenodo.24199945</a></li>
<li><strong>Converter source</strong> (AGPL-3.0): <a href="https://github.com/khshahid1970/kuickkonvert">https://github.com/khshahid1970/kuickkonvert</a></li>
<li><strong>Limitations:</strong> each test uses a few generated files. Other Ghostscript versions and real-world documents will give different numbers.</li>
</ul>
<p><em>Originally published on DEV Community: <a href="https://dev.to/kuickkonvert/i-ran-three-pdfs-through-ghostscripts-screen-ebook-and-printer-presets-heres-what-happened-4hig">https://dev.to/kuickkonvert/i-ran-three-pdfs-through-ghostscripts-screen-ebook-and-printer-presets-heres-what-happened-4hig</a></em></p>
]]></content:encoded></item></channel></rss>