Hi,
I want to apply an underline type (for example, Double) of yellow color to a portion in the attached presentation. I did it through the code, but the color is black in the saved presentation.
Here’s the code I used:
String presentationPath = “AsposeUnderlineColor.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 portion = paragraph.getPortions().get_Item(0);
System.out.println(portion.getText());
portion.getPortionFormat().setFontUnderline(
TextUnderlineType.Double);
portion.getPortionFormat().getUnderlineFillFormat()
.getSolidFillColor().setColor(new Color(255, 255, 0));
presentation.save(“AsposeUnderlineColor-result.pptx”, SaveFormat.Pptx);
Am I doing it the right way?
Thanks,
Zeljko
Zeljko