gfx creating bad quality images from pdf
题
I am using gfx to convert a particular page in a pdf to a .png image, but the image created is of very bad quality. I need to use gfx and can't use any other module. the code used is:
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)
解决方案
You can use the swfrender
其他提示
add this gfx.setparameter("zoom", "400")
You can learn more on http://wiki.swftools.org/wiki/Python_gfx_tutorial
不隶属于 StackOverflow