本文整理匯總了Python中reportlab.platypus.flowables.Image._setup_inner方法的典型用法代碼示例。如果您正苦於以下問題:Python Image._setup_inner方法的具體用法?Python Image._setup_inner怎麽用?Python Image._setup_inner使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類reportlab.platypus.flowables.Image
的用法示例。
在下文中一共展示了Image._setup_inner方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from reportlab.platypus.flowables import Image [as 別名]
# 或者: from reportlab.platypus.flowables.Image import _setup_inner [as 別名]
def __init__(self, title, enterprise, interval, logo):
self.title = title
self.enterprise = enterprise
self.interval = interval
self.logo = logo
self.width, self.height = A4
self.buf = StringIO()
self.canvas = Canvas(self.buf, pagesize=A4)
self.page_title = ''
self.page_rows = []
self.page_frags = 0
self.page_num = 1
# Build story.
self.canvas.saveState()
self.canvas.setStrokeColor(colors.RED)
self.canvas.setLineWidth(2)
self.canvas.roundRect(self.margin, self.edenwall_height + self.margin, self.width, self.height, 20, stroke=1, fill=0)
self.canvas.setFillColor(colors.GREEN2)
self.canvas.setStrokeColor(colors.GREEN1)
self.canvas.roundRect(- self.margin, - self.margin, self.width - self.margin, self.edenwall_height + self.margin,
20, stroke=1, fill=1)
# TODO do not hardcode this values.
img = Image('/var/lib/ufwi_rpcd/edenwall.png', 1209 / (300/(self.edenwall_height-self.margin/2)), self.edenwall_height-self.margin/2)
img.drawOn(self.canvas, self.margin, self.margin/4)
self.canvas.restoreState()
if self.logo:
img = Image(StringIO(self.logo))
img._setup_inner()
img.drawOn(self.canvas, (self.width - self.margin)/2 - img.drawWidth/2, 2*self.height/3)
offset = 40
self.canvas.setFillColor(black)
self.canvas.setFont("Helvetica-Bold", self.big_title_height)
self.canvas.drawCentredString((self.width-self.margin)/2, self.height/3, title)
self.canvas.setFont("Helvetica-Bold", self.frag_title_height)
self.canvas.drawString(offset, self.height - offset, enterprise)