5

PyPDF2 fail sometimes with decryption of some PDF files, and I am trying do decrypt them with pikepdf but I am getting this error: Unable to find trailer dictionary while recovering damaged file Any ideas?

Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
Yordan
  • 113
  • 2
  • 7

1 Answers1

0

You can fix broken PDF document with mutool from MuPDF:

mutool clean -d input.pdf output.pdf

However, the file might just be broken beyond recovery.

Martin Thoma
  • 124,992
  • 159
  • 614
  • 958