code: def generate_pdfa(
      pdf_pages,
      pdfmark,
      output_file,
      context,
      pdf_version,
      pdfa_part,
      progressbar_class,
      stop_on_soft_error,
  ):
      """Generate a PDF/A from the list of PDF pages and PDF/A metadata."""
      ghostscript.generate_pdfa(
          pdf_pages=[*pdf_pages, pdfmark],
          output_file=output_file,
          compression=context.options.pdfa_image_compression,
          color_conversion_strategy=context.options.color_conversion_strategy,
          pdf_version=pdf_version,
          pdfa_part=pdfa_part,
          progressbar_class=progressbar_class,
          stop_on_error=stop_on_soft_error,
      )
      return output_file
  
file_path: OCRmyPDF/src/ocrmypdf/builtin_plugins/ghostscript.py
imports: from __future__ import annotations
  import logging
  from packaging.version import Version
  from ocrmypdf import hookimpl
  from ocrmypdf._exec import ghostscript
  from ocrmypdf.exceptions import MissingDependencyError
  from ocrmypdf.subprocess import check_external_program
label_desc: Use image node_id 4 for calling a global function with example usage: generate_pdfa(pdf_pages, pdfmark, output_file, context, pdf_version, pdfa_part, progressbar_class, stop_on_soft_error) and returns: output_file