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

Free Support Forum - aspose.com

Incorrect Underline Color

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

Hi Zeljko,


I have worked with the sample code shared by you and have been able to observe the issue specified. An issue with ID SLIDESJAVA-35136 has been created 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 fixed.

Many Thanks,

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


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

Hi,


I downloaded the latest Aspose.Slides update (15.11.0) and I’m still able to reproduce the same issue.

Can you check this?

Thanks,
Zeljko

Hi Zeljko,


Thank you for getting back to us.

I would like to request you to please try using following code to set Underline Color on your end.

portion.getPortionFormat().setHardUnderlineFill(NullableBool.True);
portion.getPortionFormat().getUnderlineFillFormat().setFillType(FillType.Solid);
portion.getPortionFormat().setFontUnderline(TextUnderlineType.Double);
portion.getPortionFormat().getUnderlineFillFormat().getSolidFillColor().setColor(new Color(255, 255, 0));

Please let us know if the issue persists. We will be glad to help you further.

Best Regards,

Hi Muhammad,


The code you provided works great!

Thank you,
Zeljko
Hi Zeljko,

Thank you for your valuable feedback.

We are glad to know that your issue is resolved and things have started working on your end.

Please feel free to contact us if we could be of any help to you.

Best Regards,