Free Support Forum - aspose.com

Font hight problem in PPTX

Hi,

Does any one know why method TextCharacterPropertiesEx.getRawFontHeight() allways return NaN.

Test code is following:

PresentationEx presentation = new PresentationEx(“d:/test1.pptx”);

SlidesEx slides = presentation.getSlides();

SlideEx slide = slides.get(0);

ShapesEx shapes = slide.getShapes();

ShapeEx shape = shapes.get(0);

if(shape instanceof AutoShapeEx) {
AutoShapeEx ashape = (AutoShapeEx) shape;

System.out.println(ashape.getTextFrame().getParagraphs().get(0).getPortions().get(0).getText());
System.out.println(ashape.getTextFrame().getParagraphs().get(0).getPortions().get(0).getRawFontHeight());
}

and test PowerPoint is in attachment.

Thanks, Zeljko

Hi Zeligko,

If your font style is same as your master slide, RawFontHeight returns NAN and RawLatinFont raises NullPointerException. However, if you change the font style, it works fine. .

An issue with issue id 11698 has been crearted to investigate the problem and you will be informed in this thread as soon as it is resolved.

Hi,

How I can change style?

Thanks,

Zeljko

Hi,

Just select the placeholder and change its font. Attached is the modified one. Programmatically, accessing the font styles in the master slide raise exception right now.

Hi Zeljko,

Please download the latest version of Aspose.Slides for Java here that has fixed this issue, and use getFontHeight() method to get the font height instead of getRawFontHeight() method.

The issues you have found earlier (filed as 11698) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(3)