Browse our Products

Aspose.Slides for Java 19.4 Release Notes

KeySummaryCategory
SLIDESNET-41018Supporting of external Excel workbooksFeature
SLIDESNET-40897Support for OpenDocument encryptionFeature
SLIDESNET-40917The rendition to PDF format occupies too much RAM memoryEnhancement
SLIDESNET-40938PDF text is not searchable when exported to PDF with NotesEnhancement
SLIDESJAVA-37405Transparent Image looses transparency while converted to PDFBug
SLIDESJAVA-37564Exception on generating SVGBug
SLIDESJAVA-33319Shadow of shape is not visible in PDF and in thumbnails when export from PPTXBug
SLIDESJAVA-37587Exception on cloningBug
SLIDESJAVA-37563Exception on loading PPTXBug
SLIDESJAVA-37473ODP file not properly converted to PPTXBug
SLIDESJAVA-37565Crop-circle image is not properly written as SVGBug
SLIDESJAVA-37419Exception on converting large PPTX file to PDFBug
SLIDESJAVA-37596Font spacing is incorrect in embedded word documentsBug
SLIDESJAVA-37470Thumbnails are not properly generatedBug

Public API Changes

Support of external workbooks as a data source for charts has been added - JAVA

Since version 19.4 Aspose.Slides supports external workbooks as a data source for charts.

IResourceLoadingCallback can be used to manage external workbook loading. See New IResourceLoadingCallback interface has been added

  1. Chart data in external workbooks can be edited the same way it works for internal workbooks. If external workbook can’t be loaded an exception is thrown.
Presentation pres = new Presentation("presentation.pptx");
try
{
    IChart chart = (IChart) pres.getSlides().get_Item(0).getShapes().get_Item(0);
    ChartData chartData = (ChartData)chart.getChartData();

    assert(chartData.getDataSourceType() == ChartDataSourceType.ExternalWorkbook);

    chartData.getSeries().get_Item(0).getDataPoints().get_Item(0).getValue().getAsCell().setValue(100);
    pres.save(outPptxFileName, SaveFormat.Pptx);
}
finally {
    pres.dispose();
}
  1. An external workbook can be assigned to a chart as a data source. For this purpose IChartData.setExternalWorkbook(String workbookPath) method has been added.

setExternalWorkbook() method can be also used to update a path to the external workbook if it has been moved. Workbooks placed on remote resources unavailable for data editing but still can be assigned as an external data source. If the relative path was provided for an external workbook, it converts to full path automatically.

Presentation pres = new Presentation();
try
{
    IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Pie, 50, 50, 400, 600, false);
    IChartData chartData = chart.getChartData();

    assert(chartData.getDataSourceType() == ChartDataSourceType.ExternalWorkbook);

    chartData.setExternalWorkbook("externalWorkbook.xlsx");

    assert(chartData.getDataSourceType() == ChartDataSourceType.ExternalWorkbook);

    chartData.getSeries().add(chartData.getChartDataWorkbook().getCell(0, "B1"), ChartType.Pie);
    chartData.getSeries().get_Item(0).getDataPoints().addDataPointForPieSeries(chartData.getChartDataWorkbook().getCell(0, "B2"));
    chartData.getSeries().get_Item(0).getDataPoints().addDataPointForPieSeries(chartData.getChartDataWorkbook().getCell(0, "B3"));
    chartData.getSeries().get_Item(0).getDataPoints().addDataPointForPieSeries(chartData.getChartDataWorkbook().getCell(0, "B4"));

    chartData.getCategories().add(chartData.getChartDataWorkbook().getCell(0, "A2"));
    chartData.getCategories().add(chartData.getChartDataWorkbook().getCell(0, "A3"));
    chartData.getCategories().add(chartData.getChartDataWorkbook().getCell(0, "A4"));
    pres.save("Presentation.pptx", SaveFormat.Pptx);
}
finally {
    pres.dispose();
}
  1. Combination of methods IChartData.readWorkbookStream() and IChartData.setExternalWorkbook() can be used to create an external workbook from scratch or to make an internal workbook external.
Presentation pres = new Presentation("presentaion.pptx");
try
{
    String externalWbPath = "externalWorkbook.pptx";

    IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Pie, 50, 50, 400, 600);

    java.io.File file = new File(externalWbPath);
    if (file.exists())
        file.delete();

    byte[] worbookData = chart.getChartData().readWorkbookStream();
    FileOutputStream outputStream = new FileOutputStream(file);
    outputStream.write(worbookData);
    outputStream.close();

    chart.getChartData().setExternalWorkbook(externalWbPath);
} catch (FileNotFoundException e) {
    e.printStackTrace();
} catch (IOException e) {
    e.printStackTrace();
} finally {
    pres.dispose();
}