code: def impact_table_pdf_extractor(impact_report, component_metadata):
      
      # QGIS Composer needed certain context to generate the output
      # - Map Settings
      # - Substitution maps
      # - Element settings, such as icon for picture file or image source
  
      context = QGISComposerContext()
      extra_args = component_metadata.extra_args
  
      html_report_component_key = resolve_from_dictionary(
          extra_args, ['html_report_component_key'])
  
      # we only have html elements for this
      html_frame_elements = [
          {
              'id': 'impact-report',
              'mode': 'text',
              'text': jinja2_output_as_string(
                  impact_report, html_report_component_key),
              'margin_left': 10,
              'margin_top': 10,
          }
      ]
      context.html_frame_elements = html_frame_elements
      return context
docs: Extracting impact summary of the impact layer.
  
      For PDF generations
  
      :param impact_report: the impact report that acts as a proxy to fetch
          all the data that extractor needed
      :type impact_report: safe.report.impact_report.ImpactReport
  
      :param component_metadata: the component metadata. Used to obtain
          information about the component we want to render
      :type component_metadata: safe.report.report_metadata.
          ReportComponentsMetadata
  
      :return: context for rendering phase
      :rtype: dict
  
      .. versionadded:: 4.0