Browse our Products

Aspose.Slides for Java 25.1 Release Notes

KeySummaryCategoryRelated Documentation
SLIDESNET-42954Add support for importing embedded fonts from PDFFeature
SLIDESNET-44713Option to bypass thumbnail generation on saving a presentationEnhancement
SLIDESNET-43531Permanent method for SVG to EMF conversionFeaturehttps://docs.aspose.com/slides/net/image/#adding-svg-to-presentations
SLIDESNET-44626Extracting Office documents core, custom and extended propertiesFeaturehttps://docs.aspose.com/slides/net/presentation-properties/
SLIDESNET-44775Add an option to disable the generation of the thumbnail when saving a presentation in PPTX formatFeaturehttps://docs.aspose.com/slides/net/save-presentation/
SLIDESNET-41195Save slide to metafileFeaturehttps://products.aspose.com/slides/net/conversion/ppt-to-emf/
SLIDESJAVA-39050Use Aspose.Slides for Net 25.1 featuresEnhancement
SLIDESJAVA-39230Dashed borders in SVG images are converted to solid during SVG to EMF conversionBughttps://docs.aspose.com/slides/java/image/#adding-svg-to-presentations
SLIDESJAVA-39516Find out if a presentation file is corrupted or notEnhancementhttps://docs.aspose.com/slides/java/examine-presentation/
SLIDESJAVA-39536OutOfMemoryError occurs while processing PPTXBughttps://docs.aspose.com/slides/java/convert-powerpoint-to-pdf/#convert-powerpoint-to-pdf-in-notes-slide-view
SLIDESJAVA-38941Permanent method for SVG to EMF conversionFeaturehttps://docs.aspose.com/slides/java/image/#adding-svg-to-presentations
SLIDESJAVA-39511Red text turns white when converting slide to imageBughttps://docs.aspose.com/slides/java/convert-powerpoint-to-png/
SLIDESJAVA-39252Aspose.Slides freezes when converting PPTX to PDFBughttps://docs.aspose.com/slides/java/convert-powerpoint-to-pdf/
SLIDESJAVA-39608PPTX document is taking more than 5 mins to convert into PDFBughttps://docs.aspose.com/slides/java/convert-powerpoint-to-pdf/

Public API Changes

Support for New Extended Properties of Presentation Documents

The HeadingPair class and IHeadingPair interface have been added. It represents a ‘Heading pair’ property of the document and stores the group name of document parts and the number of parts in this group.

/**
 * <p>
 * Represents a 'Heading pair' property of the document. 
 * It indicates the group name of document parts and the number of parts in group.
 * </p>
 */
public interface IHeadingPair
{
    /**
     * <p>
     * Returns the group name of document parts.
     * Read-only String.
     * </p>
     */
    public String getName();

    /**
     * <p>
     * Returns the number of parts in group.
     * Read-only int.
     * </p>
     */
    public int getCount();
}

The following properties have also been added to the IDocumentProperties interface and the DocumentProperties class:

  • ScaleCrop property indicates the display mode of the document thumbnail;
  • LinksUpToDate property indicates whether hyperlinks in a document are up-to-date;
  • HyperlinksChanged property specifies that one or more hyperlinks in this part were updated exclusively in this part by a producer;
  • Slides read-only property specifies the total number of slides in a presentation document;
  • HiddedSlides read-only property specifies the number of hidden slides in a presentation document;
  • Notes read-only property specifies the number of slides in a presentation containing notes;
  • Paragraphs read-only property specifies the total number of paragraphs found in a document if applicable;
  • Words read-only property specifies the total number of words contained in a document;
  • MultimediaClips read-only property specifies the total number of sound or video clips that are present in the document;
  • TitlesOfParts read-only property specifies the title of each document part;
  • HeadingPairs read-only property indicates the grouping of document parts and the number of parts in each group;

The following code sample shows how to get and change the properties of a presentation document:

Presentation presentation = new Presentation("Metadata.pptx");
try {
    IDocumentProperties documentProperties = presentation.getDocumentProperties();

    // Print the read-only properties
    System.out.println("Slides: " + documentProperties.getSlides());
    System.out.println("HiddenSlides: " + documentProperties.getHiddenSlides());
    System.out.println("Notes: " + documentProperties.getNotes());
    System.out.println("Paragraphs: " + documentProperties.getParagraphs());
    System.out.println("MultimediaClips: " + documentProperties.getMultimediaClips());
    System.out.println("TitlesOfParts: " + documentProperties.getTitlesOfParts());
    System.out.println("HeadingPairs: ");
    IHeadingPair[] headingPairs = documentProperties.getHeadingPairs();
    if (headingPairs.length > 0)
    {
        for (int i = 0; i < headingPairs.length; i ++)
            System.out.println(headingPairs[i].getName() + " " + headingPairs[i].getCount());
    }

    // Change several boolean properties
    documentProperties.setScaleCrop(true);
    documentProperties.setLinksUpToDate(true);
    documentProperties.setHyperlinksChanged(true);

    // Save the presentation with changed properties
    presentation.save("Metadata-upd.pptx", SaveFormat.Pptx);
} finally {
    if (presentation != null) presentation.dispose();
}

Also, you can use the IPresentationInfo interface to read and change the document properties:

IPresentationInfo documentInfo = PresentationFactory.getInstance().getPresentationInfo("Metadata.pptx");
IDocumentProperties documentProperties = documentInfo.readDocumentProperties();

// Print the read-only properties
System.out.println("Slides: " + documentProperties.getSlides());
System.out.println("Paragraphs: " + documentProperties.getParagraphs());
System.out.println("MultimediaClips: " + documentProperties.getMultimediaClips());
System.out.println("TitlesOfParts: " + documentProperties.getTitlesOfParts());

// Change several boolean properties
documentProperties.setScaleCrop(true);
documentProperties.setLinksUpToDate(true);
documentProperties.setHyperlinksChanged(true);

// Save the presentation with changed properties
documentInfo.updateDocumentProperties(documentProperties);
documentInfo.writeBindedPresentation("Metadata.pptx");

Option to Control Thumbnail Generation

A new property, RefreshThumbnail, has been added to the IPptxOptions interface and the PptxOptions class. It allows disabling the generation of a new thumbnail when saving a presentation in the PPTX format.

The following code sample shows how to save the PPTX presentation without generation of the new thumbnail:

Presentation pres = new Presentation("demo.pptx");
try {
    PptxOptions pptxOptions = new PptxOptions();
    pptxOptions.setRefreshThumbnail(false);
    pres.save("result_with_old_thumbnail.pptx", SaveFormat.Pptx, pptxOptions);
} finally {
    if (pres != null) pres.dispose();
}

Method IPictureFillFormat.CompressImage Has Been Added

An additional method, CompressImage, has been added to the IPictureFillFormat interface and the PictureFillFormat class. It allows setting the target resolution for compression using a value from the PicturesCompression enum.

This method compresses an image by reducing its size based on the shape size and specified resolution, with the option to delete cropped areas. It adjusts the picture’s size and resolution similarly to PowerPoint’s Picture Format -> Compress Pictures -> Resolution feature. The following example demonstrates how to use the CompressImage method to reduce the size of an image in a presentation by setting a target resolution and removing cropped areas:

Presentation presentation = new Presentation("demo.pptx");
try {
    ISlide slide = presentation.getSlides().get_Item(0);

    // Get the PictureFrame from the slide
    IPictureFrame picFrame = (PictureFrame)slide.getShapes().get_Item(0);

    // Compress the image with a target resolution of 150 DPI (Web resolution) and remove cropped areas
    boolean result = picFrame.getPictureFormat().compressImage(true, PicturesCompression.Dpi150);
    
    // Check the result of the compression
    if (result)
    {
        System.out.println("Image successfully compressed.");
    }
    else
    {
        System.out.println("Image compression failed or no changes were necessary.");
    }
} finally {
    if (presentation != null) presentation.dispose();
}

Method ISlide.WriteAsEmf Has Been Added

A new method, WriteAsEmf, has been added to the ISlide interface and the Slide class. This method saving the slide content as an EMF file. The following code example demonstrates how to convert the first slide from a PowerPoint presentation into a metafile.

Presentation pres = new Presentation("Presentation.pptx");
try {
    FileOutputStream fileOutputStream = new FileOutputStream("Result.emf");
    {
        // Saves the first slide as a metafile
        pres.getSlides().get_Item(0).writeAsEmf(fileOutputStream);
    }
} finally {
    if (pres != null) pres.dispose();
}

Method ISvgImage.WriteAsEmf Has Been Added

A new method, WriteAsEmf, has been added to the ISvgImage interface and the SvgImage class. This method allows saving the SVG image as an EMF file. The following example demonstrates how to save the SVG image into a metafile.

// Creates the new SVG image
ISvgImage svgImage = new SvgImage(Files.readAllBytes(Paths.get("content.svg")));
ByteArrayOutputStream memStream = new ByteArrayOutputStream();
// Saves the SVG image as a metafile
svgImage.writeAsEmf(memStream);
// Adds metafile to the image collection
IPPImage ppImage = pres.getImages().addImage(memStream.toByteArray());

This sample demonstrates how to add the SVG image as a metafile to the presentation image collection:

Presentation pres = new Presentation();
try {
    // Creates the new SVG image
    ISvgImage svgImage = new SvgImage(new String(Files.readAllBytes(Paths.get("content.svg"))));
    ByteArrayOutputStream memStream = new ByteArrayOutputStream();
    // Saves the SVG image as a metafile
    svgImage.writeAsEmf(memStream);
    // Adds metafile to the image collection
    IPPImage ppImage = pres.getImages().addImage(memStream.toByteArray());
} finally {
    if (pres != null) pres.dispose();
}