Hi,
In the attached presentation I have three portions of text. First and third portion are underlined (first with Single, third with Double underline type). Second portion is not underlined. When I get the underline type of the second portion, the result is -1, which is TextUnderlineType.NotDefined, but it should be TextUnderlineType.None, right?
Here’s the code I used:
String presentationPath = “AsposeUnderline.pptx”;
InputStream stream = new FileInputStream(presentationPath);
Presentation presentation = new Presentation(stream);
stream.close();
ISlide slide = presentation.getSlides().get_Item(0);
IAutoShape shape = (AutoShape) slide.getShapes().get_Item(0);
ITextFrame textFrame = shape.getTextFrame();
IParagraph paragraph = textFrame.getParagraphs().get_Item(0);
IPortion underlinedPortion1 = paragraph.getPortions().get_Item(0);
IPortion noUnderlinedPortion = paragraph.getPortions().get_Item(1);
IPortion underlinedPortion2 = paragraph.getPortions().get_Item(2);
System.out.println(underlinedPortion1.getText() + "Underline Type: " + underlinedPortion1.getPortionFormat().getFontUnderline());
System.out.println(noUnderlinedPortion.getText() + "Underline Type: " + noUnderlinedPortion.getPortionFormat().getFontUnderline());
System.out.println(underlinedPortion2.getText() + "Underline Type: " + underlinedPortion2.getPortionFormat().getFontUnderline());
Can you check this?
Thanks,
Zeljko
Zeljko