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.

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

pre004.rar

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

Fri May 10, 2019 9:03 am

Hi,

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.

Sincerely,
Nancy
E-iceblue support team
User avatar

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

Thu Jul 04, 2019 10:08 am

Hi,

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();
ppt.LoadFromFile("pre004.pptx");
var autoShape = (IAutoShape)ppt.Slides[0].Shapes[0];
var fontHeight = autoShape.TextFrame.Paragraphs[0].TextRanges[0].FontHeight;

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.Presentation