/ PDF / PdfAnnotationCaption
Search results

PdfAnnotationCaption API in JavaScript PDF API control

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(true, PdfLineCaptionType.inline, [10, 10]);
// Destroy the document
document.destroy();

Properties

cap boolean

Gets the boolean flag indicating whether annotation has caption or not.

offset Array

Gets the offset position of the annotation.

type PdfLineCaptionType

Gets the caption type of the annotation.