class_docstr: Manages grafting text-only PDFs onto regular PDFs.
class_docstr_tok: ["Manages","grafting","text-only","PDFs","onto","regular","PDFs","."]
code: def __init__(self, context: PdfContext):
      self.context = context
      self.path_base = context.origin
  
      self.pdf_base = Pdf.open(self.path_base)
      self.font: Dictionary | None = None
      self.font_key: Name | None = None
  
      self.pdfinfo = context.pdfinfo
      self.output_file = context.get_path("graft_layers.pdf")
  
      self.emplacements = 1
      self.interim_count = 0
      self.render_mode = RenderMode.UNDERNEATH
  
file_path: OCRmyPDF/src/ocrmypdf/_graft.py
imports: from __future__ import annotations
  import logging
  from contextlib import suppress
  from enum import Enum
  from pathlib import Path
  from pikepdf import Dictionary, Matrix, Name, Operator, Page, Pdf, PdfError, Stream, parse_content_stream, unparse_content_stream
  from ocrmypdf._jobcontext import PdfContext
label_desc: Use image node_id 1 to create a new OcrGrafter object  with example: obj = OcrGrafter(context)