code: def _exec_page_hocr_sync(page_context: PageContext) -> HOCRResult:
      """Execute a pipeline for a single page hOCR."""
      set_thread_pageno(page_context.pageno + 1)
  
      if not is_ocr_required(page_context):
          return HOCRResult(pageno=page_context.pageno)
  
      (
          ocr_image_out,
          pdf_page_from_image_out,
          orientation_correction,
      ) = process_page(page_context)
      hocr_out, _ = ocr_engine_hocr(ocr_image_out, page_context)
  
      result = HOCRResult(
          pageno=page_context.pageno,
          pdf_page_from_image=pdf_page_from_image_out,
          hocr=hocr_out,
          orientation_correction=orientation_correction,
      )
      page_context.get_path("hocr.json").write_text(result.to_json())
      return result
  
file_path: OCRmyPDF/src/ocrmypdf/_pipelines/pdf_to_hocr.py
imports: from __future__ import annotations
  import argparse
  import logging
  import logging.handlers
  import shutil
  from functools import partial
  import PIL
  from ocrmypdf._concurrent import Executor
  from ocrmypdf._jobcontext import PageContext, PdfContext
  from ocrmypdf._pipeline import get_pdfinfo, is_ocr_required, ocr_engine_hocr, validate_pdfinfo_options
  from ocrmypdf._pipelines._common import HOCRResult, manage_work_folder, process_page, set_thread_pageno, setup_pipeline, worker_init
  from ocrmypdf._plugin_manager import OcrmypdfPluginManager
  from ocrmypdf._validation import set_lossless_reconstruction
label_desc: Use image node_id 1 for calling a global function with example usage: _exec_page_hocr_sync(page_context) and returns: result, HOCRResult