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:
-
Example presentation with couple of affected charts (original.pptx): ChartExportBug.zip (402.5 KB)
-
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!