How can I help you?
PdfAnnotationCaption
6 Feb 20262 minutes to read
PdfAnnotationCaption class represents the caption text and properties of annotations.
// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data, password);
// Get the first page
let page: PdfPage = document.getPage(0) as PdfPage;
// Get the first annotation of the page
let annotation: PdfLineAnnotation = page.annotations.at(0) as PdfLineAnnotation;
// Create and set annotation caption values
annotation.caption = new PdfAnnotationCaption({cap: true, type: PdfLineCaptionType.inline, offset: {x: 10, y: 10}});
// Destroy the document
document.destroy();Properties
Get cap boolean
Gets the boolean flag indicating whether annotation has caption or not.
Set cap void
Sets the boolean flag indicating whether annotation has caption or not.
| Parameter | Type | Description |
|---|---|---|
| value | boolean |
Caption. |
Get offset Point
Gets the offset position of the annotation.
Set offset void
Sets the offset position of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | Point |
Caption offset. |
Get type PdfLineCaptionType
Gets the caption type of the annotation.
Set type void
Sets the caption type of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | PdfLineCaptionType |
Caption type. |