Harsh Purwar
Harsh Purwar

Reputation: 57

Repair apparently damaged pdf and reduce file size

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?

Upvotes: 3

Views: 10672

Answers (3)

Dingo
Dingo

Reputation: 2765

has this pdf file reserved infos? If it has no confidential data it would be interesting to see

anyway many times where qpdf fails, Multivalent works

you can try to use its Compress tool (it also attempts to repair pdf file)

Multivalent

java -cp path....to/Multivalent.jar tool.pdf.Compress file.pdf

Upvotes: 3

John Paul Qiang Chen
John Paul Qiang Chen

Reputation: 528

This works for me to repair the damaged PDF

sudo apt-get install mupdf-tools
mutool clean input.pdf output.pdf

Upvotes: 4

Kurt Pfeifle
Kurt Pfeifle

Reputation: 90193

What result does Ghostscript give you? Try this command:

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

Upvotes: 6

Related Questions