本文整理汇总了Python中reportlab.platypus.SimpleDocTemplate.habitam_building方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleDocTemplate.habitam_building方法的具体用法?Python SimpleDocTemplate.habitam_building怎么用?Python SimpleDocTemplate.habitam_building使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类reportlab.platypus.SimpleDocTemplate
的用法示例。
在下文中一共展示了SimpleDocTemplate.habitam_building方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __to_pdf
# 需要导入模块: from reportlab.platypus import SimpleDocTemplate [as 别名]
# 或者: from reportlab.platypus.SimpleDocTemplate import habitam_building [as 别名]
def __to_pdf(tempFile, breakdown, building, begin_ts, end_ts):
doc = SimpleDocTemplate(tempFile, pagesize=landscape(A4), leftMargin=MARGIN,
rightMargin=MARGIN, topMargin=MARGIN,
bottomMargin=MARGIN,
title=u'Lista de întreținere %s' % building.name,
author='www.habitam.ro')
flowables = []
sc_title_style = ParagraphStyle(name='staircase_title', alignment=TA_CENTER)
for sc in building.apartment_groups():
if sc == building:
continue
sc_title = Paragraph(u'Lista de întreținere scara %s' %
sc.name, sc_title_style)
data = __list_data(sc, breakdown, building.services())
table = Table(data, repeatRows=1)
table.setStyle(TableStyle([
('FONT', (0, 0), (-1, 0), 'Helvetica-Bold'),
('VALIGN', (0, 0), (0, -1), 'TOP'),
('FONTSIZE', (0, 0), (-1, -1), __FONT_SIZE__),
('INNERGRID', (0, 0), (-1, -1), 0.25, colors.black),
('BOX', (0, 0), (-1, -1), 0.25, colors.black)
]))
flowables.extend([Spacer(1, .5 * cm), sc_title,
Spacer(1, cm), table,
Spacer(1, .5 * cm), signatures(__FONT_SIZE__),
PageBreak()])
doc.habitam_building = building
doc.habitam_month = begin_ts.strftime('%B %Y')
doc.habitam_display = date.today().strftime('%d %B %Y')
doc.build(flowables, onFirstPage=__list_format, onLaterPages=__list_format)
示例2: __to_pdf
# 需要导入模块: from reportlab.platypus import SimpleDocTemplate [as 别名]
# 或者: from reportlab.platypus.SimpleDocTemplate import habitam_building [as 别名]
def __to_pdf(tempFile, data, building, title):
doc = SimpleDocTemplate(tempFile, pagesize=A4, leftMargin=MARGIN,
rightMargin=MARGIN, topMargin=MARGIN,
bottomMargin=MARGIN,
title=title,
author='www.habitam.ro')
register_title_style = ParagraphStyle(name='register_title', alignment=TA_CENTER)
register_title = Paragraph(title, register_title_style)
table = Table(data, colWidths=[1.3 * cm, 3 * cm, 1.2 * cm, 7.5 * cm, 2 * cm, 2 * cm, 1.7 * cm])
table.setStyle(TableStyle([
('FONT', (0, 0), (-1, 0), 'Helvetica-Bold'),
('FONTSIZE', (0, 0), (-1, -1), __FONT_SIZE__),
('ALIGN', (0, 0), (-1, 0), 'CENTER'),
('ALIGN', (0, 0), (0, -1), 'CENTER'),
('VALIGN', (0, 0), (-1, -1), 'MIDDLE'),
('INNERGRID', (0, 0), (-1, -1), 0.25, colors.black),
('BOX', (0, 0), (-1, -1), 0.25, colors.black)
]))
flowables = [Spacer(1, 1.5 * cm), register_title, Spacer(1, cm), table]
doc.habitam_building = building
doc.build(flowables, onFirstPage=__register_format, onLaterPages=__register_format)