PointsToMillimeters
Converts points to millimeters.
Syntax
expression.PointsToMillimeters(pt);
expression - A variable that represents a Api class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| pt | Required | number | The number of points to convert to millimeters. |
Returns
number
Example
This example shows how to convert points to millimeters.
- Code
- Result
const points = 100;
const millimeters = Api.PointsToMillimeters(points);
const rgb = Api.CreateRGBColor(50, 150, 250);
const fill = Api.CreateSolidFill(rgb);
const stroke = Api.CreateStroke(0, Api.CreateNoFill());
const shape = Api.CreateShape('rect', 300 * 36000, 150 * 36000, fill, stroke);
const paragraph = shape.GetContent().GetElement(0);
paragraph.AddText(points + ' points are equal to ' + millimeters + ' millimeters.');
const presentation = Api.GetPresentation();
const slide = presentation.GetSlideByIndex(0);
slide.RemoveAllObjects();
slide.AddObject(shape);