code: def run_hocr_to_ocr_pdf_pipeline(
      options: argparse.Namespace,
      *,
      plugin_manager: OcrmypdfPluginManager,
  ) -> ExitCode:
      """Run pipeline to convert hOCR to final output PDF."""
      with manage_work_folder(
          work_folder=options.work_folder,
          retain=True,
          print_location=False,
      ) as work_folder:
          executor = setup_pipeline(options, plugin_manager)
          origin_pdf = work_folder / "origin.pdf"
  
          # Gather pdfinfo and create context
          pdfinfo = get_pdfinfo(
              origin_pdf,
              executor=executor,
              detailed_analysis=options.redo_ocr,
              progbar=options.progress_bar,
              max_workers=options.jobs,
              use_threads=options.use_threads,
              check_pages=options.pages,
          )
          context = PdfContext(
              options, work_folder, origin_pdf, pdfinfo, plugin_manager
          )
          plugin_manager.hook.check_options(options=options)
          optimize_messages = exec_hocr_to_ocr_pdf(context, executor)
  
          return report_output_pdf(
              options, origin_pdf, optimize_messages
          )
  
file_path: OCRmyPDF/src/ocrmypdf/_pipelines/hocr_to_ocr_pdf.py
imports: from __future__ import annotations
  import argparse
  import logging
  import logging.handlers
  from collections.abc import Sequence
  from functools import partial
  import PIL
  from ocrmypdf._concurrent import Executor
  from ocrmypdf._graft import OcrGrafter
  from ocrmypdf._jobcontext import PageContext, PdfContext
  from ocrmypdf._pipeline import copy_final, get_pdfinfo, render_hocr_page
  from ocrmypdf._pipelines._common import HOCRResult, manage_work_folder, postprocess, report_output_pdf, set_thread_pageno, setup_pipeline, worker_init
  from ocrmypdf._plugin_manager import OcrmypdfPluginManager
  from ocrmypdf._progressbar import ProgressBar
  from ocrmypdf.exceptions import ExitCode
label_desc: Use image node_id 3 for calling a global function with example usage: run_hocr_to_ocr_pdf_pipeline(options) and returns: report_output_pdf