We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Smart Art portion font

Hi,

I have problem to get font name from portion that is part of SmartArt shape.
This is my test:
public void test() {

PresentationEx presentation = new PresentationEx(
“vertical.pptx”);
SlideEx slide = presentation.getSlides().get_Item(0);
ShapesEx shapes = slide.getShapes();
iterate(shapes);
presentation.write("/T-vertical.pptx");
}

public void iterate(ShapesEx shapes) {
for (int i = 0; i < shapes.getCount(); i++) {
ShapeEx shape = shapes.get_Item(i);
if (shape instanceof GroupShapeEx) {
// Type casting shape to group shape
GroupShapeEx gShape = (GroupShapeEx) shape;
// Traversing through all shapes in group shape
iterate(gShape.getShapes());

}
if (shape instanceof SmartArtEx) {

// Typecast shape to SmartArtEx
SmartArtEx smart = (SmartArtEx) shape;

// Traverse through all nodes inside SmartArt
for (int k = 0; k < smart.getAllNodes().getCount(); k++) {
// Accessing SmartArt node at index i
SmartArtNodeEx node0 = smart.getAllNodes().get_Item(k);
System.out.println(node0.getTextFrame().getText());
TextFrameEx tf = node0.getTextFrame();
for (int g = 0; g < tf.getParagraphs().getCount(); g++) {
ParagraphEx pr = tf.getParagraphs().get_Item(g);
for (int e = 0; e < pr.getPortions().getCount(); e++) {
PortionEx po = pr.getPortions().get_Item(e);
po.getSmartTagClean();
if (po.getLatinFont() != null) {
String fontName = po.getLatinFont()
.getFontName();

}
}

}
node0.getTextFrame().setText(
“T-” + node0.getTextFrame().getText());
// Traversing through the child nodes in SmartArt node at
// index i
for (int j = 0; j < node0.getChildNodes().getCount(); j++) {
// Accessing the child node in SmartArt node
SmartArtNodeEx node = node0.getChildNodes().get_Item(j);

// Printing the SmartArt child node parameters
System.out.println(node.getTextFrame().getText());
}
}

}
if (shape instanceof AutoShapeEx) {
// Getting AutoShape from group shapes set
AutoShapeEx aShp = (AutoShapeEx) shape;
if (aShp.getTextFrame() != null) {
TextFrameEx tfText = aShp.getTextFrame();
if (!aShp.isTextHolder()) {
aShp.getTextFrame().setText(
“T-” + aShp.getTextFrame().getText());
}// End Text Frame IF
}
}
}
}

Generally test crashes when I do portion.createPortionFormatData();

Thanks

Hi,


I have worked with the presentation file shared by you and have been able to observe the issue specified once accessing the SmartArt shape text font. An issue with ID SLIDESJAVA-34158 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.