Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Wed Feb 22, 2023 12:51 pm

Is there a way to use `cm` and `pt` units when defining the left/top/height/width when adding a shape to a slide?

I believe spire.presentation is using `Points`? I guess I can create a converter but I need to understand what spire.presentation is using.

majeed_s
 
Posts: 80
Joined: Thu Mar 25, 2021 4:13 pm

Thu Feb 23, 2023 7:42 am

Hi,

Thanks for your inquiry.
In our products, we use “Point” as the default unit. When you add a shape to a slide, The arguments unit of the constructor is “Point”. In addition, we have a tool named PdfUnitConvertor, it can convert many units that we may need, you do not need to create an extra unit converter.
Code: Select all
            PdfUnitConvertor convertor = new PdfUnitConvertor();
            convertor.ConvertUnits(10f, PdfGraphicsUnit.Centimeter, PdfGraphicsUnit.Point);


Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Thu Feb 23, 2023 10:03 am

Thanks for confirming.

majeed_s
 
Posts: 80
Joined: Thu Mar 25, 2021 4:13 pm

Fri Feb 24, 2023 1:26 am

Hi,

Thanks for your feedback.
You are welcome, if there are any questions related to our products, just feel free to contact us, we are will to provide you with the technical supports.

Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.Presentation

cron