AddAnnotationReply

Annotations and hotspot links

Description

Adds a reply annotation to an existing annotation on the selected page and returns the 1-based index of the new reply, or 0 when no document is loaded or the target annotation is not stored as an indirect object.

Syntax

Delphi

Function TPDFlib.AddAnnotationReply(TargetAnnot: Integer; Const Author, Contents: WideString): Integer;

Parameters

TargetAnnot is the 1-based index of the annotation being replied to on the selected page. Author is the reviewer name stored in /T; Contents is the reply text.

Return Values

Returns the 1-based index of the newly appended reply annotation, or 0 when the target annotation does not exist or is not stored as an indirect object.

Remarks

The reply is a hidden Text annotation whose /IRT entry references the target and whose /RT relationship is /R (ISO 32000-1 §12.5.6.4), so PDF viewers thread it under the target in the comment panel. Combine with AddAnnotationState for review status changes. Requires PDF 1.5; the document version is raised automatically.