0

I have a pdf file which can only be opened with mupdf (both desktop and mobile) I've tried opening the same file with evince, okular, foxit reader and with my kindle paperwhite 2018. I ultimately tried the methods described here (ghostscript, pdftocairo, mutool clean) still no results.

RMPR
  • 141
  • 8
  • What happens why you try the other programs? What errors do you get? Where is the PDF from? Can you get another copy and see if your version is corrupted? What do you mean "no results"? – Randomhero Oct 15 '19 at 11:02
  • With evince Unable to open document "path_of_the_document" PDF document is damaged – RMPR Oct 15 '19 at 11:17
  • With ghostscript: `gs -o repaired.pdf -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress corrupted.pdf` You can find the output on [pastebin](https://pastebin.com/8Knq9ihV) – RMPR Oct 15 '19 at 11:23
  • with pdftocairo: `pdftocairo -pdf print.pdf print_repaired.pdf` The ouput is the following : `Syntax Error: Couldn't find trailer dictionary Syntax Error: Couldn't find trailer dictionary Syntax Error: Couldn't read xref table Error opening PDF file.` – RMPR Oct 15 '19 at 11:27
  • with `mutool clean input.pdf output.pdf` the output is the following : `error: cannot recognize version marker warning: trying to repair broken xref warning: repairing PDF document` – RMPR Oct 15 '19 at 11:41

1 Answers1

2

I've finally found a way to manage this.

  • You'll need mutool (project page)
  • On fedora it's available in the package mupdfyou can install it with the command: sudo dnf install -y mupdf

If you read the manpage, you may think that you need mupdf clean. However, if it doesn't work, what you'll need is mutool convert (documentation)

mutool convert [options] -o output input [pages]

 The 'mutool convert' command converts an input file into another format.

In this specific case:

mutool convert -o output.pdf input.pdf

RMPR
  • 141
  • 8