python 3.x - Converting PDF files to jpg through ImageMagick -


hi trying convert nonreadable pdf jpegs using following code:

import cv2 import pytesseract import re import os wand.image import image pil import image pi pyocr import pyocr pyocr import builders import io pyocr import tesseract tool  req_image = [] final_text = []  os.chdir("e:\\nonreadablepath") os.getcwd()  image(filename='e:\\nonreadablepath\\2563989.pdf') img:     print('pages = ', len(img.sequence)) img.convert('png') converted:     converted.save(filename='pyout/page.png') 

i facing error: delegateerror: pdfdelegatefailed `the system cannot find file specified. ' @ error/pdf.c/readpdfimage/800 triggering on line "with image(filename='e:\nonreadablepath\2563989.pdf') img:"

i have using python 3.6 on windows 10 using anaconda 4.4.1 have installed imagemagick , ghostscript , set envirnoment variable magick_home both of above mentioned tools.

any appreciated.


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -