Re:Show HN: Pdfwithlove – PDF tools that run 100% locally (n...
by sam_lowry_ on Monday January 19, 2026 @03:52AM
(#46676485)
That's why they all get a flag from me. I am already well served by ghostscript, GIMP, Imagemagick, etc:
Optimize PDF:
#!/bin/bash
INPUT="$1"
OUTPUT="$(mktemp --suffix=.pdf)"
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook \
-dNOPAUSE -dQUIET -dBATCH -sOutputFile="$OUTPUT" "$INPUT"
mv "$OUTPUT" "$INPUT"
Merge PDF: #!/bin/sh
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \
-dCompatibilityLevel=1.3 -dPDFSETTINGS=/ebook \
-sOutputFile=merged.pdf "$@"
And so on and so forth.
Re:Show HN: Pdfwithlove – PDF tools that run 100% locally (n...
by ptspts on Monday January 19, 2026 @04:02AM
(#46676575)
Your commands to process PDF with Ghostscript are lossy (they lose lots of metadata and in minor ways they also change how the PDF renders), and they produce very large PDF files.
Re:Show HN: Pdfwithlove – PDF tools that run 100% locally (n...
by x3ro on Monday January 19, 2026 @04:09AM
(#46676630)
Can you expand on why the produced PDF files are supposed to be larger than the originals? I've not observed that yet.
Re:Show HN: Pdfwithlove – PDF tools that run 100% locally (n...
by tedk-42 on Monday January 19, 2026 @04:36AM
(#46676846)
You're being downvoted because not everyone has CLI access to a server and the required ghostscript binaries etc.
Realistically, most 'normal users' have PDF needs like these links and we as tech people can safely give these sites to non-technical people and have confidence their data isn't being stolen on remote dodgy servers (think gas / electricity bills, invoices, bank statements etc which is a PII gold pot).
Re:Show HN: Pdfwithlove – PDF tools that run 100% locally (n...
by sam_lowry_ on Monday January 19, 2026 @05:38AM
(#46677374)
Server? what server? Ghostscript is available in virtually any Linux distro, on Mac with and without brew and even on Windows.
I have no confidence in any website, especially the one that claims to be local-only but can technically change on a whim of the developer once it starts getting enough traffic from users.
OTOH, I trust 30+ years old software sitting on on my hard drive not to phone home on every keystroke.
Re:Show HN: Pdfwithlove – PDF tools that run 100% locally (n...
by kkfx on Monday January 19, 2026 @05:21AM
(#46677231)
To better compress my personal preference is
pdftops -paper A4 -expand -level3 file.pdf # I'm from EU, so A4 is my common paper format
ps2pdf14 -dEmbedAllFonts=true \
-dUseFlateCompression=true \
-dOptimize=true \
-dProcessColorModel=/DeviceRGB \
-r72 \
-dDownsampleGrayImages=true \
-dGrayImageResolution=150 \
-dAutoFilterGrayImages=false \
-dGrayImageDownsampleType=/Bicubic \
-dDownsampleMonoImages=true \
-dMonoImageResolution=150 \
-dMonoImageDownsampleType=/Subsample \
-dDownsampleColorImages=true \
-dColorImageResolution=150 \
-dAutoFilterColorImages=false \
-dColorImageDownsampleType=/Bicubic \
-dPDFSETTINGS=/ebook \
-dNOSAFER \
-dALLOWPSTRANSPARENCY \
-dShowAnnots=false \
file.ps compressed.pdf
Re:Show HN: Pdfwithlove – PDF tools that run 100% locally (n...
by sam_lowry_ on Monday January 19, 2026 @05:41AM
(#46677406)
If you do `-dEmbedAllFonts=true` then probably `-dSubsetFonts=true` would also be useful.
And for the rest, `-dPDFSETTINGS=/ebook` should already have most of the values that you set explicitely.
They're all wrapping PDFlib and provide the same functionality.