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.
Software Recommendations Stack Exchange is a question and answer site for people seeking specific software recommendations. It only takes a minute to sign up.Sign up to join this community
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.
I can suggest you of two ways of doing that...
(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)
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
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.
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.