Pdf2image library of Python throws "No font in show/space" error

315 views Asked by At

For a few pdfs the pdf2image library throws this error. I have set strict=True in the convert_from_path method and hence I am getting these syntax errors

I think it means that my system doesn't have the required fonts but is there any other way to solve this issue?

I believe it's actually a poppler issue and but I haven't been able to find anything on it.

Here's a snippet of the code:

pg_img = convert_from_path(pdf_path, dpi=calculated_dpi, first_page=i + 1, last_page=i + 1, fmt='jpeg',
                                           jpegopt={"quality": 100, "progressive": True, "optimize": True}, strict=True)
                pg_img[0].save(os.path.join(img_folder_dir, file_name+"_"+str(i) + ".jpg"), format='JPEG', quality=85)

This is the error: "Syntax Error (1077): No font in show/space Syntax Error (1117): No font in show/space Syntax Error: Unknown font tag 'F5' "

0

There are 0 answers