class_docstr: Implements OCR with Tesseract.
class_docstr_tok: ["Implements","OCR","with","Tesseract","."]
code: def generate_pdf(input_file, output_pdf, output_text, options):
      tesseract.generate_pdf(
          input_file=input_file,
          output_pdf=output_pdf,
          output_text=output_text,
          languages=options.languages,
          engine_mode=options.tesseract_oem,
          tessconfig=options.tesseract_config,
          timeout=options.tesseract_timeout,
          pagesegmode=options.tesseract_pagesegmode,
          thresholding=options.tesseract_thresholding,
          user_words=options.user_words,
          user_patterns=options.user_patterns,
      )
  
imports: from __future__ import annotations
  import logging
  import os
  from PIL import Image
  from ocrmypdf import hookimpl
  from ocrmypdf._exec import tesseract
  from ocrmypdf._jobcontext import PageContext
  from ocrmypdf.cli import numeric, str_to_int
  from ocrmypdf.helpers import clamp
  from ocrmypdf.imageops import calculate_downsample, downsample_image
  from ocrmypdf.pluginspec import OcrEngine
  from ocrmypdf.subprocess import check_external_program
label_desc: Use image node_id 8 for calling the TesseractOcrEngine obj's underlying member method code with example usage: obj.generate_pdf(input_file, output_pdf, output_text, options) without return types