'error: Unable to find trailer dictionary while recovering damaged file

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?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source