在Python 3.6.5中将PDF转换为图像:在PythonMagick中设置dpi的问题

时间:2018-08-16 16:34:05

标签: python-3.x dpi pythonmagick

我无法设置Image对象的dpi。代码的最后一行总是向我抛出一条错误消息。.请参见以下内容:

import PythonMagick
from PythonMagick import Image 
p = PythonMagick.Image()    
p.density('300')     # --> This is the line where the error occurs

错误如下:

Traceback (most recent call last):

File "<ipython-input-45-3dabab8b125b>", line 2, in <module>
p.density('300')

ArgumentError: Python argument types in
   Image.density(Image, str)
did not match C++ signature:
  density(class Magick::Image {lvalue})
  density(class Magick::Image {lvalue}, class Magick::Point)

0 个答案:

没有答案