Table of Contents

Method AddTextOverlayToFile

Namespace
LMKit.Document.Pdf
Assembly
LM-Kit.NET.dll

AddTextOverlayToFile(string, int, PageElement, string, PdfSaveOptions)

Adds an invisible text overlay to a single page of a PDF file using a precomputed PageElement. No OCR is performed.

public static void AddTextOverlayToFile(string inputPath, int pageIndex, PageElement pageElement, string outputPath, PdfSaveOptions saveOptions = PdfSaveOptions.None)

Parameters

inputPath string

Path to the source PDF file.

pageIndex int

Zero-based index of the target page.

pageElement PageElement

The page layout containing text elements and their bounding boxes.

outputPath string

Path where the modified PDF will be written.

saveOptions PdfSaveOptions

Options controlling how the modified PDF is written. Default: full rewrite.

Exceptions

ArgumentNullException

inputPath, pageElement, or outputPath is null.

FileNotFoundException

The file specified by inputPath does not exist.

Share