Method AddTextOverlayToFile
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
inputPathstringPath to the source PDF file.
pageIndexintZero-based index of the target page.
pageElementPageElementThe page layout containing text elements and their bounding boxes.
outputPathstringPath where the modified PDF will be written.
saveOptionsPdfSaveOptionsOptions controlling how the modified PDF is written. Default: full rewrite.
Exceptions
- ArgumentNullException
inputPath,pageElement, oroutputPathisnull.- FileNotFoundException
The file specified by
inputPathdoes not exist.