Site icon Voina Blog (a tech warrior's blog)

A free and new way to shrink pdf files in Windows

Advertisements

I always missed some nice Linux tools when I work on Windows. I know that is nice to have a fancy GUI but sometimes you cannot do even simple things without paying a lot for some bloated application. There is the simple problem of optimizing pdf files, especially big manuals, pdf files containing images or pdf files obtained by scanning documents. Bellow is a free and easy way to do it in any new Windows 10.

STEP 1: Enable the Linux user space
See my post about this Windows finally has an OS in it


STEP 2: Install GNU gv, a user interface for the Ghostscript PostScript(TM) interpreter

1. Start “Bash on Ubuntu on Windows” from start menu
2. In the bash console type:


# sudo apt-get install gv

This will install GNU gv, a user interface for the Ghostscript PostScript(TM) interpreter. Note that you will not be able to use the gv application fully because it needs an X11 display which is not available yet. The secret is that we can force gv not to use the default x11display output device by forcing it to use a placeholder device like with parameter -sDEVICE=pdfwrite.

STEP 3: Shrink a pdf file in one line
I have a big pdf file obtained by scanning some documents which the scanner automatically dumps in a pdf file. The file is 25Mb in size.
The following one liner shrinks it to 4.4Mb


# gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=Documents-ebook.pdf Documents.ps

In fact you can do even more things. Have a look of the post Manipulate PDFs with gostscript

[paypal_donation_button]

Exit mobile version