Repair apparently damaged pdf and reduce file size

Harsh Purwar picture Harsh Purwar · Jun 15, 2012 · Viewed 7.5k times · Source

I have a PDF file (4.6MB) which was made by combining 6 different PDFs (containing both text and bitmap graphics) using pdftk in Ubuntu 12.04. I wish to compress this file to something close to 2MB without affecting its quality.

I have tried pdftk's "compress" option (couldn't compress it to 2 MB), also tried converting it to ps first and than back to pdf, it gives the following warning:

****Warning: considering '0000000000 XXXXX n' as a free entry.

and then hangs. qpdf also failed saying that the file is damaged.

Could someone help me out?

Answer

Kurt Pfeifle picture Kurt Pfeifle · Jun 16, 2012

What result does Ghostscript give you? Try this command:

gs \
  -o output.pdf \
  -sDEVICE=pdfwrite \
  -dPDFSETTINGS=/screen \
   input.pdf