1

I have a pdf file containing a single page with scans of some documents. I want to remove obsolete parts of the page (I tried cropping and overlaying a white rectangle) and save it again. I expected the resulting file to be smaller than the original, but it's always much larger. Even when I only say convert 1.pdf 2.pdf, 2.pdf is six times larger than 1.pdf (1.3 vs 0.22 MB). Why is that?

I tried display interactively and convert, with similar results. I tried -compress but the result is either crap or large. Are there better alternatives to imagemagick? Unfortunately I can't publish the file.

3

Why does imagemagick increase the file size of my pdf?

Are there better alternatives to imagemagick?

Go ahead and overlay the image part from the document as you normally would, get that saved to a PDF and then use GhostScript to reduce the size of the PDF document.

Once you download and install GhostScript onto the machine to shrink the PDF files from, you could run the below logic to reduce the size of the PDF file from an elevated command prompt.

Instructions

Be sure:

  1. the GhostScript gswin64c.exe file points where it's installed on your system
  2. the -sOutputFile="C:\PDFFolder\Reduced\ReducedSize.pdf" part points to the full path folder and file location where to save the reduced size file
  3. the "C:\PDFFolder\ToReduce\Reduce.pdf" part directly after #2 points to the full path folder and file location to shrink.

"C:\Program Files\gs\gs\bin\gswin64c.exe" -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dPDFSETTINGS=/ebook -sOutputFile="C:\PDFFolder\Reduced\ReducedSize.pdf" "C:\PDFFolder\ToReduce\Reduce.pdf"

Further Resources

  • thanks a lot, this works nicely, now the new file is indeed smaller than the original. I just added the linux version of the command line because the windows version with absolute paths is hard to read on small screens – user829755 Aug 18 '16 at 6:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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