Varinha Python converter PDF para PNG desativar transparente (alpha_channel)
Estou tentando converter um PDF para PNG - tudo funciona bem, no entanto, a imagem de saída ainda é transparente, mesmo quando acredito que a desabilitei:
with Image(filename='sample.pdf', resolution=300) as img:
img.background_color = Color("white")
img.alpha_channel = False
img.save(filename='image.png')
O acima produz as imagens, mas são transparentes, eu também tentei o abaixo:
with Image(filename='sample.pdf', resolution=300, background=Color('white')) as img:
img.alpha_channel = False
img.save(filename='image.png')
que produz este erro:
Traceback (most recent call last):
File "file_convert.py", line 20, in <module>
with Image(filename='sample.pdf', resolution=300, background=Color('white')) as img:
File "/Users/Frank/.virtualenvs/wand/lib/python2.7/site-packages/wand/image.py", line 1943, in __init__
raise TypeError("blank image parameters can't be used with image "
TypeError: blank image parameters can't be used with image opening parameters