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

Free Support Forum - aspose.com

Exception Is Thrown on Attempt to Access SolidFillColor

Using apose.slides for java version 21.5 I am getting exception:

Exception in thread “main” class com.aspose.slides.exceptions.InvalidOperationException: Color is not resolved yet.
com.aspose.slides.gl.do(Unknown Source)
com.aspose.slides.nn.char(Unknown Source)
com.aspose.slides.nn.getSolidFillColor(Unknown Source)

Code snippet to reproduce it:

    License license = new License();
    license.setLicense(new ByteArrayInputStream(LICENSE_INFO.getBytes()));
    Presentation presentation = new Presentation( inputFileName);
    ISlide testSlide = presentation.getSlides().get_Item(0);
    IAutoShape autoShape = (IAutoShape)testSlide.getShapes().get_Item(0);
    IParagraph paragraph = autoShape.getTextFrame().getParagraphs().get_Item(0);
    IPortion portion = paragraph.getPortions().get_Item(0);
    Color color = portion.getPortionFormat().getEffective().getUnderlineFillFormat().getSolidFillColor();

file_to_reproduce.zip (222.1 KB)

Just to make it clear - I did try latest 21.6 version of aspose.slides - it throws the same exception

@smartling

I have observed the issue shared by you and have created a ticket with ID SLIDESJAVA-38572 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 notified once the issue will be fixed.

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

@smartling,
The behavior you was experienced is almost normal. The fill type of UnderlineFillFormat data is ‘NoFill’ in that particular case, so that makes SolidFillColor meaningless as well as other fills. With fixing this issue, a more detailed explanation was added to InvalidOperationException.