pdf2image Syntax Error: Invalid encryption key length Command Line Error: Incorrect password

138 Views Asked by At

I'm trying to convert a pdf to image using the python library pdf2image. With other pdfs the code it seems to work (I'm using the method pdf2image.convert_to_path(PATH_TO_PDF_FILE)), but on this it returns the following error:

pdf2image.exceptions.PDFPageCountError: Unable to get page count.
Syntax Error: Invalid encryption key length
Command Line Error: Incorrect password

I've already tried to read the pdf with the python library pypdf, and i've seen the pdf is encrypted. To be more specific, I have to install pycryptodome, without it PyPDF it's not able to decode pdf with 256 AES encryption, so I presume the pdf has this type of encryption that pdf2image is not able to decode itself.

Has anyone else ever had a similar error with pdf2image?

0

There are 0 best solutions below