我使用gfx将pdf中的特定页面转换为.png图像,但创建的图像质量非常差。我需要使用gfx,不能使用任何其他模块。使用的代码是:
import gfx
pdf_loc=”C:\new.pdf”
pagenumber=12
doc = gfx.open('pdf',pdf_loc)
page = doc.getPage(page_number)
img = gfx.ImageList()
img.setparameter("antialise", "1") # turn on antialising
img.startpage(page.width,page.height)
page.render(img)
img.endpage()
input_loc="C:\newimg.png"
img.save(input_loc)发布于 2011-08-12 03:10:33
您可以使用swfrender
发布于 2013-08-10 11:32:31
添加此缩放(“gfx.setparameter”,"400")
您可以在http://wiki.swftools.org/wiki/Python_gfx_tutorial上了解更多信息
https://stackoverflow.com/questions/6345653
复制相似问题