THotPDF.NewLoadedAnnotation Method
Creates a new annotation dictionary of the specified subtype on the specified page of the loaded PDF document, suitable for appending various annotations such as highlights, links, and text annotations to an existing PDF
Declaration
function NewLoadedAnnotation(PageIndex: Integer; const ASubtype: AnsiString; ARect: THPDFRect): THPDFDictionaryObject;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
PageIndex | Zero-based index of the target page, specifying the page where the annotation is located |
X1 | Left coordinate of the annotation rectangle, in PDF user space |
Y1 | Lower coordinate of the annotation rectangle, in PDF user space |
X2 | Right coordinate of the annotation rectangle, in PDF user space |
Y2 | Upper coordinate of the annotation rectangle, in PDF user space |
ASubtype | Annotation subtype name, e.g. Text, Link or Highlight, matching the Subtype key of the PDF specification |
Return value
Returns a dictionary object representing the newly created annotation
Usage notes
- Use this API in the document creation workflow before the affected page, resource, field or catalogue object is finalised
- Newly created annotations are automatically registered to the target page's Annots array; there is no need to manually append them to the page dictionary
- If the returned dictionary object is modified before saving the document, the document's internal modification mechanism must be used; the reference must not be held after the document is closed