Method AddTextOverlay
AddTextOverlay(Attachment, int, PageElement, PdfSaveOptions)
Adds an invisible text overlay to a single page of a PDF attachment using a precomputed PageElement. No OCR is performed.
public static Attachment AddTextOverlay(Attachment source, int pageIndex, PageElement pageElement, PdfSaveOptions saveOptions = PdfSaveOptions.None)
Parameters
sourceAttachmentThe source PDF attachment to modify.
pageIndexintZero-based index of the target page.
pageElementPageElementThe page layout containing text elements and their bounding boxes.
saveOptionsPdfSaveOptionsOptions controlling how the modified PDF is written. Default: full rewrite.
Returns
- Attachment
A new Attachment containing the modified PDF.
Exceptions
- ArgumentNullException
sourceorpageElementisnull.