code: def rasterize_pdf_page(
      input_file: Path,
      output_file: Path,
      raster_device: str,
      raster_dpi: Resolution,
      pageno: int,
      page_dpi: Resolution | None,
      rotation: int | None,
      filter_vector: bool,
      stop_on_soft_error: bool,
  ) -> Path:
      """Rasterize one page of a PDF at resolution raster_dpi in canvas units.
  
      The image is sized to match the integer pixels dimensions implied by
      raster_dpi even if those numbers are noninteger. The image's DPI will
      be overridden with the values in page_dpi.
  
      Args:
          input_file: The PDF to rasterize.
          output_file: The desired name of the rasterized image.
          raster_device: Type of image to produce at output_file.
          raster_dpi: Resolution in dots per inch at which to rasterize page.
          pageno: Page number to rasterize (beginning at page 1).
          page_dpi: Resolution, overriding output image DPI.
          rotation: Cardinal angle, clockwise, to rotate page.
          filter_vector: If True, remove vector graphics objects.
          stop_on_soft_error: If there is an "soft error" such that PDF page image
              generation can proceed, but may visually differ from the original,
              the implementer of this hook should raise a detailed exception. If
              ``False``, continue processing and report by logging it. If the hook
              cannot proceed, it should always raise an exception, regardless of
              this setting. One "soft error" would be a missing font that is
              required to properly rasterize the PDF.
  
      Returns:
          Path: output_file if successful
  
      Note:
          This hook will be called from child processes. Modifying global state
          will not affect the main process or other child processes.
  
      Note:
          This is a :ref:`firstresult hook<firstresult>`.
      """
  
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  from argparse import ArgumentParser, Namespace
  from collections.abc import Sequence, Set
  from logging import Handler
  from pathlib import Path
  from typing import TYPE_CHECKING, NamedTuple
  import pluggy
  from ocrmypdf import Executor, PdfContext
  from ocrmypdf._progressbar import ProgressBar
  from ocrmypdf.helpers import Resolution
label_desc: Use image node_id 8 for calling a global function with example usage: rasterize_pdf_page(input_file, output_file, raster_device, raster_dpi, pageno, page_dpi, rotation, filter_vector, stop_on_soft_error) without return types