Skip to main content

SetIntent

Sets intent type for this annotation.

Syntax

expression.SetIntent(intentType);

expression - A variable that represents a ApiFreeTextAnnotation class.

Parameters

NameRequired/OptionalData typeDefaultDescription
intentTypeRequiredFreeTextIntentThe intent type of the free text annotation.

Returns

boolean

Example

Assign a purpose type to a text annotation in a PDF.

// How do I specify what kind of comment a text annotation is in a PDF?

// Define the annotation's purpose and verify it in a PDF.

let doc = Api.GetDocument();
let freeTextAnnot = Api.CreateFreeTextAnnot([160, 50, 360, 135]);
let page = doc.GetPage(0);
page.AddObject(freeTextAnnot);
freeTextAnnot.SetIntent("freeTextCallout");
freeTextAnnot.SetCallout([{x: 161, y: 51}, {x: 249, y: 125}, {x: 261, y: 125}]);
freeTextAnnot.SetRectDiff([100, 64, 0.5, 0.5]);
console.log(`Annot intent is: ${freeTextAnnot.GetIntent()}`);