Bug in Aspose.Slides for Java - Truncated Chart after Exporting Copied Slides

Dear Aspose Support Team,

We have encountered a critical bug in the Aspose.Slides for Java library, specifically related to charts being truncated after exporting. Below are the details of the issue, along with the necessary information for your review:

Reproduction Steps:

  1. Example presentation with couple of affected charts (original.pptx): ChartExportBug.zip (402.5 KB)

  2. Code triggering the bug:

@Test
public void chartBugTest2Reproduction() throws IOException {
        // import original
	Presentation presentation = new Presentation(new FileInputStream(
            new File("/path/to/original.pptx")));

        // create new presentation and copy all slides from original to the new one
	Presentation newPres = new Presentation();
	newPres.getSlideSize().setSize(SlideSizeType.Widescreen, SlideSizeScaleType.DoNotScale);
	for (var slide : presentation.getSlides()) {
		newPres.getSlides().addClone(slide);
	}

        // remove empty first slide (unimportant)
	newPres.getSlides().removeAt(0);

        // export new presentation to disk as pptx
	newPres.save(new FileOutputStream(
            new File("/path/to/export.pptx")),SaveFormat.Pptx);
}

Issue Description:

  • Example Expected Chart Appearance (Slide 1): expected.png (6.2 KB)
  • Example Aspose Exported Chart Appearance (Slide 1): actual.png (3.8 KB)
  • The zip also contains a export.pptx that we created, but it is easily reproducible with the steps from the code snipped on top

Observations:

  • Slides 1 to 8 are all affected with a truncated chart after the export
  • The top chart in Slide 7 is displayed correctly after the export meanwhile the bottom chart is cut
  • When selecting the chart and opening “Select Data”, the chart refreshes and is displayed correctly like in the original
  • We attempted to use Aspose to update every chart in every slide but this results in other bugs (hidden data in Slide 9 gets visible etc.):
public static void handleAsposeBugs(ISlide asposeSlide) {
	for (int i = 0; i < asposeSlide.getShapes().size(); i++) {
		var shape = asposeSlide.getShapes().get_Item(i);

		if (shape instanceof IChart) {
			var chart = (IChart) shape;

			try {
				var bytes = chart.getChartData().readWorkbookStream();

				if (bytes != null && bytes.length > 0) {
					chart.getChartData().writeWorkbookStream(bytes);
				}
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
}

Environment:

  • Aspose.Slides version: 24.5
  • Java version: 17
  • Operating Systems: macOS 14.2.1 & Windows 11 & Ubuntu 22.04

Your prompt attention to this matter is highly appreciated. Please let us know if any additional information is required to investigate and resolve this issue.

Thank you for your assistance.

Best regards,

Justin Voitel
Domino informatics GmbH

** Edit: **
An approximate time frame when the error will be fixed would be helpful!

@justinvo,
Thank you for describing the issues. I’ve reproduced the problems you found. We apologize for any inconvenience caused.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): 
  SLIDESJAVA-39485 - Charts are truncated after cloning presentation slides
  SLIDESJAVA-39486 - Hidden chart data becomes visible after rewriting the workbook

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Unfortunately, I cannot share an ETA, but our developers will do their best to resolve the issues as soon as possible.

The issues you found earlier (filed as SLIDESJAVA-39486,SLIDESJAVA-39485) have been fixed in Aspose.Slides for Java 24.8 (JAR).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.