THotPDF.SetLoadedAnnotationContents Method
Modifies the text of the Contents field of a specific annotation on the specified page of the loaded PDF document, used for updating the visible text content of the annotation/Contents string and invalidates its page's render cache
This method preserves the existing appearance and rich text; changing /Contents alone does not rebuild visible FreeText text in /AP
Declaration
procedure SetLoadedAnnotationContents(PageIndex, AnnotationIndex: Integer; const AContents: AnsiString);
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
PageIndex | Zero-based index of the target page |
AnnotationIndex | The zero-based index of the target annotation in the page annotation array |
AContents | The new text string to write to the annotation's Contents entry |
Usage notes
This member returns no value
Usage notes
- Use zero-based page and annotation indices in a loaded document; if the annotation is not found, this method returns without changing it
- Some annotation types (such as link annotations) do not display Contents; setting this value has no visual effect on those types
SetLoadedFreeTextPlainTextwhen explicitly converting a supported FreeText annotation to a new visible ASCII Helvetica appearance - The save method must be called after modifications are complete to persist the changes
SetLoadedFreeTextRichTextfor the separate rich-text metadata workflow