Free Support Forum - aspose.com

Units in cm

Hello,



How can I use cm as unit?

I have used next code but it won’t work.

Text text1 = new Text(sec1, “this is text content”);
text1.Top = 1cm;
text1.PositioningType = PositioningType.PageRelative;
text1.TextInfo.BackgroundColor = new Aspose.Pdf.Color(“Red”);
sec1.Paragraphs.Add(text1);


Can you tell me why.

Kind regards Bart


Hello Bart,

Thanks for considering Aspose.

I'm afraid in API, only point unit is supported. You can only use cm unit inside an XML.

FYI

1 inch = 72 points;
1 cm = 28.3 points

As a workaround, you can use the point equivalent of cm when using API. We apologize for your inconvenience.