PPTX to PDF - Glow and shadow effects not preserved (C# .NET)

Hi,

According to the Slides.NET 19.1 release notes the bug SLIDESNET-32305 Gradient and shadow effects are lost for shapes in PDF is resolved. However, in a project where we would like to apply a glow or shadow around a Chart data label, the glow or shadow works in the PPTX but is lost in the exported PDF. I have attached an image demonstrating our issue.

I assume this is a similar issue to Pdf rendering Issues. Can you tell me if this issue should be resolved? Or have I misinterpreted the issue described in ticket 32305?

Thank you.

Capture.PNG (124.0 KB)

@statista_it,

I have observed your requirements and suggest you to please try using Aspose.Slides for .NET 19.10 on your end. In case the issue is still reproduced, please share the working sample code along with source and generated PDF file and we will add that in our issue tracking system for investigation.

Hi Mudassir,

I can’t share the sample code, but I can replicate it using 19.10 and the Aspose docs code example for a pie chart, from Create or Update PowerPoint Presentation Charts in C# or .NET|Aspose.Slides Documentation

output.zip (66.6 KB)

        // Instantiate Presentation class that represents PPTX file
        Presentation pres = new Presentation();

        // Access first slide
        ISlide slides = pres.Slides[0];

        // Add chart with default data
        IChart chart = slides.Shapes.AddChart(ChartType.Pie, 100, 100, 400, 400);

        // Setting chart Title
        chart.ChartTitle.AddTextFrameForOverriding("Sample Title");
        chart.ChartTitle.TextFrameForOverriding.TextFrameFormat.CenterText = NullableBool.True;
        chart.ChartTitle.Height = 20;
        chart.HasTitle = true;

        // Set first series to Show Values
        chart.ChartData.Series[0].Labels.DefaultDataLabelFormat.ShowValue = true;

        // Setting the index of chart data sheet
        int defaultWorksheetIndex = 0;

        // Getting the chart data worksheet
        IChartDataWorkbook fact = chart.ChartData.ChartDataWorkbook;

        // Delete default generated series and categories
        chart.ChartData.Series.Clear();
        chart.ChartData.Categories.Clear();

        // Adding new categories
        chart.ChartData.Categories.Add(fact.GetCell(0, 1, 0, "First Qtr"));
        chart.ChartData.Categories.Add(fact.GetCell(0, 2, 0, "2nd Qtr"));
        chart.ChartData.Categories.Add(fact.GetCell(0, 3, 0, "3rd Qtr"));

        // Adding new series
        IChartSeries series = chart.ChartData.Series.Add(fact.GetCell(0, 0, 1, "Series 1"), chart.Type);

        // Now populating series data
        series.DataPoints.AddDataPointForPieSeries(fact.GetCell(defaultWorksheetIndex, 1, 1, 20));
        series.DataPoints.AddDataPointForPieSeries(fact.GetCell(defaultWorksheetIndex, 2, 1, 50));
        series.DataPoints.AddDataPointForPieSeries(fact.GetCell(defaultWorksheetIndex, 3, 1, 30));

        // Not working in new version
        // Adding new points and setting sector color
        // series.IsColorVaried = true;
        chart.ChartData.SeriesGroups[0].IsColorVaried = true;

        IChartDataPoint point = series.DataPoints[0];
        point.Format.Fill.FillType = FillType.Solid;
        point.Format.Fill.SolidFillColor.Color = Color.Cyan;
        // Setting Sector border
        point.Format.Line.FillFormat.FillType = FillType.Solid;
        point.Format.Line.FillFormat.SolidFillColor.Color = Color.Gray;
        point.Format.Line.Width = 3.0;
        point.Format.Line.Style = LineStyle.ThinThick;
        point.Format.Line.DashStyle = LineDashStyle.DashDot;

        IChartDataPoint point1 = series.DataPoints[1];
        point1.Format.Fill.FillType = FillType.Solid;
        point1.Format.Fill.SolidFillColor.Color = Color.Brown;

        // Setting Sector border
        point1.Format.Line.FillFormat.FillType = FillType.Solid;
        point1.Format.Line.FillFormat.SolidFillColor.Color = Color.Blue;
        point1.Format.Line.Width = 3.0;
        point1.Format.Line.Style = LineStyle.Single;
        point1.Format.Line.DashStyle = LineDashStyle.LargeDashDot;

        IChartDataPoint point2 = series.DataPoints[2];
        point2.Format.Fill.FillType = FillType.Solid;
        point2.Format.Fill.SolidFillColor.Color = Color.Coral;

        // Setting Sector border
        point2.Format.Line.FillFormat.FillType = FillType.Solid;
        point2.Format.Line.FillFormat.SolidFillColor.Color = Color.Red;
        point2.Format.Line.Width = 2.0;
        point2.Format.Line.Style = LineStyle.ThinThin;
        point2.Format.Line.DashStyle = LineDashStyle.LargeDashDotDot;

        // Create custom labels for each of categories for new series
        IDataLabel lbl1 = series.DataPoints[0].Label;

        // lbl.ShowCategoryName = true;
        lbl1.DataLabelFormat.ShowValue = true;

        IDataLabel lbl2 = series.DataPoints[1].Label;
        lbl2.DataLabelFormat.ShowValue = true;
        lbl2.DataLabelFormat.ShowLegendKey = true;
        lbl2.DataLabelFormat.ShowPercentage = true;

        IDataLabel lbl3 = series.DataPoints[2].Label;
        lbl3.DataLabelFormat.ShowSeriesName = true;
        lbl3.DataLabelFormat.ShowPercentage = true;

        // Showing Leader Lines for Chart
        series.Labels.DefaultDataLabelFormat.ShowLeaderLines = true;

        // Setting Rotation Angle for Pie Chart Sectors
        chart.ChartData.SeriesGroups[0].FirstSliceAngle = 180;

        foreach (var label in chart.ChartData.Series[0].Labels)
        {
            var effectFormat = label.DataLabelFormat.TextFormat.PortionFormat.EffectFormat;
            effectFormat.EnableGlowEffect();
            effectFormat.GlowEffect.Color.Color = Color.White;
            effectFormat.GlowEffect.Radius = 4;
        }

        // Save presentation with chart
        var path = "C:\\officeconsumer\\output\\AsposeChart_out";
        pres.Save(path+".pptx", SaveFormat.Pptx);

        pres.Save(path+".pdf", SaveFormat.Pdf);

@statista_it,

I have observed the example shared and have been able to observe the issue. An issue with ID SLIDESNET-41527 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 notified once the issue will be fixed.

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