PdfMeasurementUnit
12 Sep 20251 minute to read
Public Enum to define measurement unit of line measurement annotation.
// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data, password);
// Access first page
let page: PdfPage = document.getPage(0);
// Access the annotation at index 0
let annotation: PdfLineAnnotation = page.annotations.at(0) PdfLineAnnotation;
// Sets the measurement unit of line measurement annoation as centimeter
annotation.unit = PdfMeasurementUnit.centimeter;
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();-
centimeter- Specifies the type ofcentimeter. -
inch- Specifies the type ofinch. -
millimeter- Specifies the type ofmillimeter. -
pica- Specifies the type ofpica. -
point- Specifies the type ofpoint.