当前位置: 首页>>代码示例>>Python>>正文


Python ImpactReport.print_to_pdf方法代码示例

本文整理汇总了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))
开发者ID:NyakudyaA,项目名称:inasafe,代码行数:37,代码来源:batch_dialog.py


注:本文中的safe.report.impact_report.ImpactReport.print_to_pdf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。