code: def _exec_hocrtransform_sync(page_context: PageContext) -> HOCRResult:
      """Process each page."""
      hocr_json = page_context.get_path("hocr.json")
      if not hocr_json.exists():
          # No hOCR file, so no OCR was performed on this page.
          return HOCRResult(pageno=page_context.pageno)
      hocr_result = HOCRResult.from_json(hocr_json.read_text())
      hocr_result.textpdf = render_hocr_page(
          page_context.get_path("ocr_hocr.hocr"), page_context
      )
      return hocr_result
  
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 1 for calling a global function with example usage: _exec_hocrtransform_sync(page_context) and returns: hocr_result, HOCRResult