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

Free Support Forum - aspose.com

Text shadow effect


how I can get shadow effect (properties of shadow effect) of text from my presentation?


Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

You can use AutoShape.getEffectFormat().getOuterShadowEffect() and AutoShape.getInnerShadowEffect().getInnerShadowEffect() to get the shadow effect of Text and it’s properties.

Please see the following code to get Shadow Effect from text.

//Instantiate a PPTX class

PresentationEx presentation = new PresentationEx("d:\\data\\table.pptx");

//Get first slide

SlideEx slide= presentation.getSlides().get_Item(0);

// Get Text Frame

AutoShapeEx autoShape = (AutoShapeEx)slide.getShapes().get_Item(0);

//Get Shadow Effect

OuterShadow outerShadow = autoShape.getEffectFormat().getOuterShadowEffect();

//Print the color of Shadow Effect


Hopefully, it will help you achieve your desired results.

Thanks & Regards,

Owais Ahmad


You can please try using following sample code that is in accordance with latest Aspose.Slides for Java 20.7 API.

    public static void TestShadow()
        //Create an instance of Presentation class
        Presentation pres = new Presentation();

        //Get reference of the slide
        ISlide sld = pres.getSlides().get_Item(0);

        //Add an AutoShape of Rectangle type
        IAutoShape ashp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 150, 75, 150, 50);

        //Add TextFrame to the Rectangle
        ashp.addTextFrame("Aspose TextBox");

        // Disable shape fill in case we want to get shadow of text.

        // Add outer shadow and set all necessary parameters
        IOuterShadow shadow = ashp.getEffectFormat().getOuterShadowEffect();
        shadow.setDirection (45);

        //Write the presentation to disk
        pres.save("D:\\OutShadow.pptx", SaveFormat.Pptx);