Annotations Class
Provides functionality for managing and interacting with PDF annotations.
export declare class Annotations implements EventElement<AnnotationEventMap>
- Inheritance:
-
Annotations
Implements
Remarks
This class handles the creation, management, and events related to PDF annotations. It provides access to all annotations in the document through the items property and manages various annotation services including electronic signatures.
Properties
items
Gets all annotations in the document.
get items(): ReadonlyArray<Annotation>;
Remarks
This read-only property returns an array of all annotations currently present in the PDF document. The returned array is immutable and cannot be modified directly. Use the appropriate annotation creation methods to add new annotations to the document.
Methods
addEventListener(K, (event: AnnotationEventMap[K]) => void)
Adds an event listener for the specified event type.
addEventListener<K extends keyof AnnotationEventMap>(type: K, listener: (event: AnnotationEventMap[K]) => void): void;
Parameters
-
type
The event type/name to listen for.
-
listener
The callback function that will be invoked when the event is emitted.