本文整理汇总了Python中xhtml2pdf.xhtml2pdf_reportlab.PmlImage类的典型用法代码示例。如果您正苦于以下问题:Python PmlImage类的具体用法?Python PmlImage怎么用?Python PmlImage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PmlImage类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: start
def start(self, c):
lst = _list_style_type.get(c.frag.listStyleType or "disc", _bullet)
frag = copy.copy(c.frag)
self.offset = 0
if frag.listStyleImage is not None:
frag.text = u""
f = frag.listStyleImage
if f and (not f.notFound()):
img = PmlImage(
f.getData(),
width=None,
height=None)
img.drawHeight *= dpi96
img.drawWidth *= dpi96
img.pisaZoom = frag.zoom
img.drawWidth *= img.pisaZoom
img.drawHeight *= img.pisaZoom
frag.image = img
self.offset = max(0, img.drawHeight - c.frag.fontSize)
else:
if type(lst) == type(u""):
frag.text = lst
else:
# XXX This should be the recent font, but it throws errors in Reportlab!
frag.text = lst(c)
# XXX This should usually be done in the context!!!
frag.fontName = frag.bulletFontName = tt2ps(frag.fontName, frag.bold, frag.italic)
c.frag.bulletText = [frag]