Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents from any .NET(C#, VB.NET, ASP.NET, .NET Core) application and Java (J2SE and J2EE) application.

Thu May 09, 2019 4:16 pm

Why follow code returns Not-a-Number (NaN) value?

Code: Select all
var pre = new Presentation(pptxStream, FileFormat.Auto);
var autoShape = (IAutoShape)pre.Slides[0].Shapes[0];
var fontHeight = autoShape.TextFrame.TextRange.FontHeight;

Spire.Presentation version is 4.4.10


Posts: 40
Joined: Wed Sep 26, 2018 12:03 pm

Fri May 10, 2019 9:03 am


Thank you for contacting us.
I noticed the issue that the FontHeight returns NaN. I have submitted the issue to our Dev team for further investigation and fixing. If there is any update, we will inform you. Sorry for the inconvenience caused.

E-iceblue support team
User avatar

Posts: 184
Joined: Wed Apr 03, 2019 2:33 am

Thu Jul 04, 2019 10:08 am


Thanks for your patient waiting.
The reported issue has been fixed. Welcome to download the release Spire.Presentation Pack Version:4.7. In addition, each textframe may have more than one paragraph, each paragraph may have more than one textrange and different textranges may have different font heights, hence, please use the following code to obtain the FontHeight of specific textrange.
Code: Select all
Presentation ppt = new Presentation();
var autoShape = (IAutoShape)ppt.Slides[0].Shapes[0];
var fontHeight = autoShape.TextFrame.Paragraphs[0].TextRanges[0].FontHeight;

E-iceblue support team
User avatar

Posts: 1135
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.Presentation