Browse our Products

Aspose.Slides for Android via Java 21.6 Release Notes

KeySummaryCategory
SLIDESANDROID-327Use Aspose.Slides for Java 21.6 featuresEnhancement

Public API Changes

Support of Presentation to XAML export

To support Presentation export to XAML, we added new API members.

IXamlOptions interface and XamlOptions class. IXamlOptions definition:

/**
 * <p>
 * Options that control how a XAML document is saved.
 * </p>
 */
public interface IXamlOptions extends ISaveOptions
{
    /**
	<p>
	Determines whether hidden slides will be exported.
	</p>
     */
    public boolean getExportHiddenSlides();
    /**
	<p>
	Determines whether hidden slides will be exported.
	</p>
     */
    public void setExportHiddenSlides(boolean value);
    
    /**
	<p>
	Represents an implementation of IOutputSaver interface.
	</p>
     */
    public IXamlOutputSaver getOutputSaver();
    /**
	<p>
	Represents an implementation of IOutputSaver interface.
	</p>
     */
    public void setOutputSaver(IXamlOutputSaver value);
}

For Presentation export to XAML, a new Save method overload got added to the Presentation class:

/**
 * <p>
 * Saves all slides of a presentation to a set of files representing XAML markup.
 * </p>
 */
public final void save(IXamlOptions options)

This code sample demonstrates the exporting of a Presentation to a set of XAML files:

Presentation pres = new Presentation("pres.pptx");
try {
    XamlOptions xamlOptions = new XamlOptions();
    xamlOptions.setExportHiddenSlides(true);
	
    pres.save(xamlOptions);
} finally {
    if (pres != null) pres.dispose();
}

The XAML files get saved in a newly created folder—“pres”.

The IXamlOutputSaver interface allows you to define your own output-saving service. IXamlOutputSaver definition:

/**
 * <p>
 * Represents an output saver implementation for transfer data to the external storage.
 * </p>
 */
public interface IXamlOutputSaver
{
    /**
     * <p>
     * Saves a bytes array to a destination location.
     * </p>
     * @param path The destination path.
     * @param data A binary data for saving to a destination location.
     */
    public void save(String path, byte[] data);
}

IEffect.getTargetShape() method has been added

The IEffect.getTargetShape() method has been added. It returns the shape affected by the effect.

Method declaration:

/**
 * <p>
 * Returns target shape for effect.
 * Read-only {@link IShape}.
 * </p>
 */
public IShape getTargetShape();

This code sample demonstrates the output of information for all animated shapes in the main sequence for all slides in a presentation.

Presentation pres = new Presentation("SomePresentation.pptx");
try {
    for (ISlide slide : pres.getSlides())
        for (IEffect effect : slide.getTimeline().getMainSequence())
            System.out.println(effect.getType() + " animation effect is set to shape#" + effect.getTargetShape().getUniqueId() + " on slide#" + slide.getSlideNumber());
} finally {
    if (pres != null) pres.dispose();
}