Aspose.Slides for Java 17.3 Release Notes

Key Summary Category
SLIDESNET-38440 Get audio/video rendered as audio/video in Html Feature
SLIDESNET-38431 Support for adding Asopse.Slides.xml file in nuget package Feature
SLIDESNET-38361 Support of detection Microsoft PowerPoint 95 presentations Feature
SLIDESNET-38192 Support to get chart external data source workbook path Feature
SLIDESNET-37586 Getting actual absolute X,Y values for chart data points Feature
SLIDESNET-34526 Support for adding line in chart area Feature
SLIDESNET-38426 Create new chart base on style of existing chart Feature
SLIDESNET-37469 Extracting Excel table data in presentation as Text in XPS Feature
SLIDESJAVA-35959 Loading fonts from jar file Feature
SLIDESJAVA-35764 Get Max value of vertical axis on a chart Feature
SLIDESJAVA-35703 High Memory consumption while converting pptx to pdf Bug
SLIDESJAVA-35397 Problem while translating the pdf generated by Aspose.Slides Bug
SLIDESJAVA-36055 Missing font exception Bug
SLIDESJAVA-36043 When PPT file is saved as PDF, the percentage sign goes on the wrong side Bug
SLIDESJAVA-36042 Font loader not working Bug
SLIDESJAVA-35825 Text being overlapped with Image Bug
SLIDESJAVA-35687 Missing characters in converted svg Bug
SLIDESJAVA-35589 Embedded fonts are not considered when generating slide images Bug
SLIDESJAVA-35177 Transitions appear on ppt load and save Bug
SLIDESJAVA-35176 Animations lost on ppt load and save Bug
SLIDESJAVA-34032 Category axis labels are missing or improperly rendered in generated PDF Bug

Public API Changes

getActualMaxValue, getActualMinValue, getActualMajorUnit, getActualMinorUnit, getActualMajorUnitScale, getActualMinorUnitScale have been added to com.aspose.slides.Axis and IAxis

  • double getActualMaxValue() Gets actual maximum value on the axis.
  • double getActualMinValue()  Gets actual minimum value on the axis.
  • double getActualMajorUnit() Gets actual major unit of the axis.
  • double getActualMinorUnit() Gets actual minor unit of the axis.
  • /TimeUnitType/ int getActualMajorUnitScale()       Gets actual major unit scale of the axis.
  • /TimeUnitType/ int getActualMinorUnitScale()       Gets actual minor unit scale of the axis.

Call method IChart.validateChartLayout() previously to get actual values for these properties.

final Presentation pres = new Presentation();
try
{
    Chart chart = (Chart) pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Area, 100, 100, 500, 350);
    chart.validateChartLayout();

    double maxValue = chart.getAxes().getVerticalAxis().getActualMaxValue();
    double minValue = chart.getAxes().getVerticalAxis().getActualMinValue();

    double majorUnit = chart.getAxes().getHorizontalAxis().getActualMajorUnit();
    double minorUnit = chart.getAxes().getHorizontalAxis().getActualMinorUnit();
}
finally { ((IDisposable)pres).dispose(); }

getActualX, getActualY, getActualWidth, getActualHeight have been added to com.aspose.slides.IChartPlotArea, ChartPlotArea

  • float getActualX()      Gets actual X location (left) of the chart element relative to the left top corner of the chart. Call method IChart.validateChartLayout() before to get actual values.
  • float getActualY()      Gets actual top of the chart element relative to the left top corner of the chart. Call method IChart.validateChartLayout() before to get actual values.
  • float getActualWidth()           Gets actual width of the chart element. Call method IChart.validateChartLayout() before to get actual values.
  • float getActualHeight()          Gets actual height of the chart element. Call method IChart.validateChartLayout() before to get actual values.

Call method IChart.validateChartLayout() previously to get actual values for these properties.

final Presentation pres = new Presentation();
try {
    Chart chart = (Chart) pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 100, 100, 500, 350);
    chart.validateChartLayout();

    double x = chart.getPlotArea().getActualX();
    double y = chart.getPlotArea().getActualY();
    double w = chart.getPlotArea().getActualWidth();
    double h = chart.getPlotArea().getActualHeight();
}
finally { ((IDisposable)pres).dispose(); }

getDataSourceType and getExternalWorkbookPath have been added to com.aspose.slides.IChartData, ChartData

Two new getters have been added to IChartData interface and ChartData class:

  • DataSourceType of ChartDataSourceType enum, which represents data source of the chart.
  • ExternalWorkbookPath of type string, which represents external workbook path if data source is external, null otherwise.
  • ChartDataSourceType is a new enum which represents the two values: InternalWorkbook and ExternalWorkbook.

Example:

final Presentation pres = new Presentation("pres.pptx");
try
{
    ISlide slide = pres.getSlides().get_Item(1);
    IChart chart = (IChart)slide.getShapes().get_Item(0);
    /*ChartDataSourceType*/ int sourceType = chart.getChartData().getDataSourceType();
    if (sourceType == ChartDataSourceType.ExternalWorkbook)
    {
        String path = chart.getChartData().getExternalWorkbookPath();
    }
}
finally { ((IDisposable)pres).dispose(); }

com.aspose.slides.IActualLayout interface has been added

Methods of IActualLayout provide information about actual position of parent chart element. It is necessary to call method IChart.validateChartLayout() previously to fill properties with actual values.

final Presentation pres = new Presentation();
try {
    Chart chart = (Chart) pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 100, 100, 500, 350);
    chart.validateChartLayout();

    double x = chart.getPlotArea().getActualX();
    double y = chart.getPlotArea().getActualY();
    double w = chart.getPlotArea().getActualWidth();
    double h = chart.getPlotArea().getActualHeight();
}
finally { ((IDisposable)pres).dispose(); }

Method validateChartLayout() has been added to com.aspose.slides.IChart interface and Chart class

Calculates actual values of chart elements. The actual values include position of elements that implement IActualLayout interface (IActualLayout.getActualX, IActualLayout.getActualY, IActualLayout.getActualWidth, IActualLayout.getActualHeight) and actual axes values (IAxis.getActualMaxValue, IAxis.getActualMinValue, IAxis.getActualMajorUnit, IAxis.getActualMinorUnit, IAxis.getActualMajorUnitScale, IAxis.getActualMinorUnitScale).

final Presentation pres = new Presentation();
try {
    Chart chart = (Chart) pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 100, 100, 500, 350);
    chart.validateChartLayout();

    double x = chart.getPlotArea().getActualX();
    double y = chart.getPlotArea().getActualY();
    double w = chart.getPlotArea().getActualWidth();
    double h = chart.getPlotArea().getActualHeight();
}
finally { ((IDisposable)pres).dispose(); }

New method loadExternalFont has been added to com.aspose.slides.FontsLoader class

The new method LoadExternalFont has been added to FontsLoader class:

  • public static void LoadExternalFont(byte[] data)

This method allows to add font from the binary data.

// loading presentation uses SomeFont which is not installed on the system
final Presentation pres = new Presentation("pres.pptx");
try
{
    // load SomeFont from file into the byte array
    byte[] fontData = File.readAllBytes("fonts\SomeFont.ttf");
    // load font represented as byte array
    FontsLoader.loadExternalFont(fontData);
    // font SomeFont will be available during the rendering or other operations
}
finally { ((IDisposable)pres).dispose(); }

Ppt95 value has been added to com.aspose.slides.LoadFormat enumeration

The new Ppt95 value has been added to LoadFormat enumeration. This value represents Microsoft PowerPoint 95 presentation format.

Code snippet to check whether the presentation format is old Microsoft PowerPoint 95:

boolean isOldFormat = PresentationFactory.getInstance().getPresentationInfo(path).getLoadFormat() == LoadFormat.Ppt95;