我想在Python的PyX绘图中包含一个PDF文件。你知道吗
要包含SVG文件:
from pyx import *
c = canvas.canvas()
c.insert(svgfile.svgfile(0, 0, "file.svg"))
c.writeSVGfile("output")
要包含EPS文件:
from pyx import *
c = canvas.canvas()
c.insert(epsfile.epsfile(0, 0, "file.eps"))
c.writeEPSfile("output")
但是尝试PDF文件,它不起作用:
from pyx import *
c = canvas.canvas()
c.insert(pdffile.pdffile(0, 0, "file.pdf"))
c.writePDFfile("output")
如何插入PDF文件?你知道吗
不幸的是,PyX中没有包含PDF格式的PDF。(不过,这是一个长期目标。)
你现在唯一能做的“解决方案”就是把你的PDF文件转换成位图(可能是png),然后用位图模块把它添加到你的输出中。你知道吗
相关问题 更多 >
编程相关推荐