簡體   English   中英

gfx 從 pdf 創建質量差的圖像

[英]gfx creating bad quality images from pdf

我正在使用 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)

添加這個 gfx.setparameter("zoom", "400")

您可以在http://wiki.swftools.org/wiki/Python_gfx_tutorial上了解更多信息

您可以使用swfrender

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM