本文整理汇总了Python中safe.report.impact_report.ImpactReport.print_to_pdf方法的典型用法代码示例。如果您正苦于以下问题:Python ImpactReport.print_to_pdf方法的具体用法?Python ImpactReport.print_to_pdf怎么用?Python ImpactReport.print_to_pdf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类safe.report.impact_report.ImpactReport
的用法示例。
在下文中一共展示了ImpactReport.print_to_pdf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_pdf
# 需要导入模块: from safe.report.impact_report import ImpactReport [as 别名]
# 或者: from safe.report.impact_report.ImpactReport import print_to_pdf [as 别名]
def create_pdf(self, title, output_directory, impact_layer, count=0, index=None):
"""Create PDF report from impact layer.
Create map & table report PDF based from impact_layer data.
:param title: Report title.
:type title: str
:param output_directory: Output directory.
:type output_directory: str
:param impact_layer: Impact layer instance.
:type impact_layer: QgsMapLayer
:param count: The number of scenarios that were run.
:type count: int
:param index: A sequential number to place at the beginning of the
file name.
:type index: int, None
See also:
Dock.printMap()
"""
# FIXME: check if impact_layer is the real impact layer...
template = resources_path("qgis-composer-templates", "inasafe-portrait-a4.qpt")
impact_report = ImpactReport(self.iface, template, impact_layer)
LOGGER.debug("Create Report: %s" % title)
map_path, table_path = self.report_path(output_directory, title, count, index)
# create map and table pdf
map_path, table_path = impact_report.print_to_pdf(map_path)
LOGGER.debug("Report done %s %s" % (map_path, table_path))