Skip to main content

GetRect

Sets annotation rect.

Inherited from ApiBaseAnnotation.GetRect.

Example

Get the rectangular boundary of an annotation in a PDF.

// What is the area occupied by an annotation in a PDF?

// Read the bounding rectangle coordinates of an annotation object in a PDF.

let doc = Api.GetDocument();
let squareAnnot = Api.CreateSquareAnnot([10, 10, 160, 32]);
let page = doc.GetPage(0);
page.AddObject(squareAnnot);
console.log(`Annotation rect is: ${squareAnnot.GetRect()}`);