code: def validate_pdfinfo_options(context: PdfContext) -> None:
      """Validate the PDF info options."""
      pdfinfo = context.pdfinfo
      options = context.options
  
      if pdfinfo.needs_rendering:
          raise InputFileError(
              "This PDF contains dynamic XFA forms created by Adobe LiveCycle "
              "Designer and can only be read by Adobe Acrobat or Adobe Reader."
          )
      if pdfinfo.has_signature:
          if options.invalidate_digital_signatures:
              log.warning("All digital signatures will be invalidated")
          else:
              raise DigitalSignatureError()
      if pdfinfo.has_acroform:
          if options.redo_ocr:
              raise InputFileError(
                  "This PDF has a user fillable form. --redo-ocr is not "
                  "currently possible on such files."
              )
          else:
              log.warning(
                  "This PDF has a fillable form. "
                  "Chances are it is a pure digital "
                  "document that does not need OCR."
              )
              if not options.force_ocr:
                  log.info(
                      "Use the option --force-ocr to produce an image of the "
                      "form and all filled form fields. The output PDF will be "
                      "'flattened' and will no longer be fillable."
                  )
      if pdfinfo.is_tagged:
          if options.force_ocr or options.skip_text or options.redo_ocr:
              log.warning(
                  "This PDF is marked as a Tagged PDF. This often indicates "
                  "that the PDF was generated from an office document and does "
                  "not need OCR. PDF pages processed by OCRmyPDF may not be "
                  "tagged correctly."
              )
          else:
              raise TaggedPDFError()
      context.plugin_manager.hook.validate(
          pdfinfo=pdfinfo, options=options
      )
  
imports: from __future__ import annotations
  import logging
  import os
  import re
  import sys
  from collections.abc import Iterable, Iterator, Sequence
  from contextlib import suppress
  from pathlib import Path
  from shutil import copyfileobj, copystat
  from typing import Any, BinaryIO, TypeVar, cast
  import img2pdf
  import pikepdf
  from PIL import Image, ImageColor, ImageDraw
  from ocrmypdf._concurrent import Executor
  from ocrmypdf._exec import unpaper
  from ocrmypdf._jobcontext import PageContext, PdfContext
  from ocrmypdf._metadata import repair_docinfo_nuls
  from ocrmypdf.exceptions import DigitalSignatureError, DpiError, EncryptedPdfError, InputFileError, PriorOcrFoundError, TaggedPDFError, UnsupportedImageFormatError
  from ocrmypdf.helpers import IMG2PDF_KWARGS, Resolution, safe_symlink
  from ocrmypdf.hocrtransform import DebugRenderOptions, HocrTransform
  from ocrmypdf.hocrtransform._font import Courier
  from ocrmypdf.pdfa import generate_pdfa_ps
  from ocrmypdf.pdfinfo import Colorspace, Encoding, PageInfo, PdfInfo
  from ocrmypdf.pluginspec import OrientationConfidence
label_desc: Use image node_id 5 for calling a global function with example usage: validate_pdfinfo_options(context) without return types