문제

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top