Is there any tool to batch resize (change dpi, e.g. from 600 dpi to 300 dpi) large amount (100,000+) PDF files? Preferably for Windows command line.

I have no budget, so the tool must come free of charge.


4 Answers 4


You can probably use imagemagick to change your PDF.

Combined with a simple for-loop (or something more advanced like parallel), you can cook up something like this:

for %f in (originals\*) do convert %f -density 300 resized\%f

Note that if you put that into a batch file, you need to escape the percent signs.


You could use PDFTK-Server and using the command below to compress the files you need.

convert input.pdf -compress Zip output.pdf

Here you can find the whole manual https://www.pdflabs.com/docs/pdftk-man-page/


I can suggest you of two ways of doing that...

  1. (simpler one BUT not viable when you have a lot of PDFs) use online tools to do that; for example: http://www.ilovepdf.com/compress_pdf or https://www.pdfcompress.com/ (just a couple of links, you can just google for "online pdf compressor" and you'll find a lot)

  2. use ghostscript; this is the way you'll have to follow when you have to deal with a lot of PDFs file. As already mentioned by Frederick Nord in his answer you need to put it in a for-loop within your batch file (using ghostscript instead of imagemagick in this case), so here's an example command:

    for %f in (originals\*) do gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=resized\%f %f

Here's a reference link for the gs command you may find interesting and here's official documentation.

Finally, you'll surely appreciate even Kurt Pfeifle great answers on StackOverflow and here on SoftwareRecs.

  • P.S. Irfanview can make use of ghostscript too (see here), so you may want to give it try to do the batch file manipulation in a graphical way (some usage examples here and here).
    – danicotra
    Commented Nov 12, 2016 at 14:59

To supplement the answer of danicotra, in respect of the first solution, Ilovepdf, I can tell you right now that you can use a programmer-friendly API to process your PDF files in batches.

Ilovepdf API

Disclaimer: I am the main developer of the Ruby's Ilovepdf repository.

PS: I would insert a comment directly in danicotra's message but my Stackoverflow reputation does not suffice to do such action.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.