使用python魔杖将PDF转换为图像

时间:2019-07-05 01:37:28

标签: python imagemagick-convert wand

我正在使用wand.image包在python 3中将pdf转换为图像文件,但出现操作系统错误。我无法解决此OSError。任何帮助将不胜感激。

import os
from wand.image import Image as Img

pdf = Img(filename='test.pdf', resolution=200)

OSError                                   Traceback (most recent call last)
<ipython-input-4-afa6ce7d6c5b> in <module>()
----> 1 pdf=Img(filename='test.pdf',resolution=200)

~\Anaconda3\lib\site-packages\wand\image.py in __init__(self, image, blob, file, filename, format, width, height, depth, background, resolution, pseudo)
   6404                     self.read(blob=blob, resolution=resolution)
   6405                 elif filename is not None:
-> 6406                     self.read(filename=filename, resolution=resolution)
   6407                 # clear the wand format, otherwise any subsequent call to
   6408                 # MagickGetImageBlob will silently change the image to this

~\Anaconda3\lib\site-packages\wand\image.py in read(self, file, filename, blob, resolution)
   6791         elif filename is not None:
   6792             filename = encode_filename(filename)
-> 6793             r = library.MagickReadImage(self.wand, filename)
   6794         if not r:
   6795             self.raise_exception()

OSError: exception: access violation reading 0xFFFFFFFFFFFFFFFF

0 个答案:

没有答案