code: def print_map(self):
          
          # Check if selected layer is valid
          impact_layer = self.parent.iface.activeLayer()
          if impact_layer is None:
              # noinspection PyCallByClass,PyTypeChecker
              QtWidgets.QMessageBox.warning(
                  self,
                  'InaSAFE',
                  tr(
                      'Please select a valid impact layer before trying to '
                      'print.'))
              return
  
          # Get output path from datastore
          # Fetch report for pdfs report
          report_path = os.path.dirname(impact_layer.source())
          output_paths = [
              os.path.join(
                  report_path,
                  'output/impact-report-output.pdf'),
              os.path.join(
                  report_path,
                  'output/inasafe-map-report-portrait.pdf'),
              os.path.join(
                  report_path,
                  'output/inasafe-map-report-landscape.pdf'),
          ]
  
          # Make sure the file paths can wrap nicely:
          wrapped_output_paths = [
              path.replace(os.sep, '<wbr>' + os.sep) for path in
              output_paths]
  
          # create message to user
          status = m.Message(
              m.Heading(tr('Map Creator'), **INFO_STYLE),
              m.Paragraph(tr(
                  'Your PDF was created....opening using the default PDF '
                  'viewer on your system. The generated pdfs were saved '
                  'as:')))
  
          for path in wrapped_output_paths:
              status.add(m.Paragraph(path))
  
          send_static_message(self, status)
  
          for path in output_paths:
              # noinspection PyCallByClass,PyTypeChecker,PyTypeChecker
              QtGui.QDesktopServices.openUrl(
                  QtCore.QUrl.fromLocalFile(path))
docs: Open impact report dialog used to tune report when printing.