Browse our Products

Aspose.Slides for Java 17.11 Release Notes

KeySummaryCategory
SLIDESNET-39228Rendering comments when saving Presentation documents into imageFeature
SLIDESJAVA-36546Support for End Paragraph Run PropertiesFeature
SLIDESNET-38055Set slide hidden doesn’t work when saving to ODP formatFeature
SLIDESNET-39232Improve rendering comments into PDF / HTMLFeature
SLIDESNET-39379Extend support for Hidden Slides for Open Document Presentation formatFeature
SLIDESJAVA-36045PPTX to PDF conversion gives OutOfMemoryErrorBug
SLIDESJAVA-36604When PPT is converted to PDF, text in diagrams is missing.Bug
SLIDESJAVA-36497Error while loading ppt with Embedded XLS ObjectBug
SLIDESJAVA-35977Embedded visio text not properly displayed in SVG formatBug
SLIDESJAVA-36402PDF file extremely enlarged when converted from PPT to PDFBug
SLIDESJAVA-36547Poor Performance when converting PPSX to PDFBug
SLIDESJAVA-36579PptxReadException: TiffImageException on loading presentationBug
SLIDESJAVA-36646NullPointerException on exporting to HTMLBug
SLIDESJAVA-36654Bullet signs are not rendered correctly in the result of saving a PowerPoint into SVG formatBug

Public API Changes

Methods Paragraph.getEndParagraphPortionFormat and setEndParagraphPortionFormat have been added to Slides.Java

A new methods getEndParagraphPortionFormat/setEndParagraphPortionFormat have been added. These methods specifies the portion properties that are to be used if another portion is inserted after the last one.

IParagraph paragraph = autoShape.getTextFrame().getParagraphs().get_Item(0);
IPortionFormat endParaPortionFormat = paragraph.getEndParagraphPortionFormat();

Possibility to control the look of layouting of notes and comments in exported document - Java

A new getNotesCommentsLayouting method has been added to PdfOptions, TiffOptions, SwfOptions and HtmlOptions classes. It allows specifying look and layouting of notes and comments in exported document.

Returned object of type INotesCommentsLayoutingOptions has the following methods:

  • getNotesPositions/setNotesPosition - Gets or sets value of the NotesPosition enum as position of the notes on the page.
  • getCommentsPositions/setCommentsPositions - Gets or sets value of the CommentsPosition enum as position of the comments on the page.
  • getCommentsAreaColor /setCommentsAreaColor - Gets or sets color of the comments area.
  • getCommentsAreaWidth/setCommentsAreaWidth - Gets or sets the width of the comments area in pixels.

The following code allows exporting presentation to PDF document with comments placed left and truncated notes (shown only on first page).

Presentation presentation = new Presentation("Presentation.pptx");
try{
    PdfOptions opt = new PdfOptions();
    opt.getNotesCommentsLayouting().setNotesPosition(NotesPositions.BottomTruncated);
    opt.getNotesCommentsLayouting().setCommentsPosition(CommentsPositions.Right);
    presentation.save("PresOut.pdf", SaveFormat.Pdf, opt);
}finally {
    presentation.dispose();
}

The following example allows changing default color of comments area or width of comments area.

Presentation presentation = new Presentation("Presentation.pptx");
try{
    PdfOptions opt = new PdfOptions();
    opt.getNotesCommentsLayouting().setNotesPosition( NotesPositions.BottomTruncated);
    opt.getNotesCommentsLayouting().setCommentsPosition( CommentsPositions.Right);
    opt.getNotesCommentsLayouting().setCommentsAreaWidth( 300);
    opt.getNotesCommentsLayouting().setCommentsAreaColor( java.awt.Color.CYAN);
    presentation.save("PresOut.pdf", SaveFormat.Pdf, opt);
}finally {
    presentation.dispose();
}

Elements SwfNotes, TiffNotes, HtmlNotes and PdfNotes of SaveFormat enumeration and methods getIncludeComments/setIncludeComments of SwfOptions, TiffOptions, HtmlOptions and PdfOptions are obsolete now.

Pay attention, NotesCommentsLayouting.NotesPosition has no effect when you use obsolete elements of SaveFormat. And if you use obsolete property IncludeComments of SwfOptions, TiffOptions, HtmlOptions or PdfOptions classes then NotesCommentsLayouting.CommentsPosition, NotesCommentsLayouting.CommentsAreaWidth and NotesCommentsLayouting.CommentsAreaColor have no effect too.

Possibility to export a presentation to a set of BufferedImage objects -

All added methods accept an object of type INotesCommentsLayoutingOptions, which allows to specify look of layouting of notes and comments in received BufferedImage objects.

The following methods have been added to the Presentation class and the IPresentation interface:

public java.awt.image.BufferedImage[] getThumbnails(INotesCommentsLayoutingOptions notesCommentsLayouting);
public java.awt.image.BufferedImage[] getThumbnails(INotesCommentsLayoutingOptions notesCommentsLayouting, int[] slides);
public java.awt.image.BufferedImage[] getThumbnails(INotesCommentsLayoutingOptions notesCommentsLayouting, float scaleX, float scaleY);
public java.awt.image.BufferedImage[] getThumbnails(INotesCommentsLayoutingOptions notesCommentsLayouting, int[] slides, float scaleX, float scaleY);
public java.awt.image.BufferedImage[] getThumbnails(INotesCommentsLayoutingOptions notesCommentsLayouting,java.awt.Dimension imageSize);
public java.awt.image.BufferedImage[] getThumbnails(INotesCommentsLayoutingOptions notesCommentsLayouting, int[] slides,java.awt.Dimension imageSize);

For example, to get a set of BufferedImage objects for all existing slides with the arrangement of comments on the right, including full notes, you can use the following code:

Presentation presentation = new Presentation("Presentation.pptx");
try{
    NotesCommentsLayoutingOptions options = new NotesCommentsLayoutingOptions();
    options.setCommentsPosition(CommentsPositions.Right);
    options.setNotesPosition(NotesPositions.BottomFull);

    BufferedImage[] bmps = presentation.getThumbnails(options);
}finally {
    presentation.dispose();
}

To obtain an image of a specific slide, for example, slides 2 and 7, without displaying comments and with notes truncated to the size of the page, you can use the following code:

Presentation presentation = new Presentation("Presentation.pptx");
try{
    NotesCommentsLayoutingOptions options = new NotesCommentsLayoutingOptions();
    options.setNotesPosition(NotesPositions.BottomTruncated);

    BufferedImage[] bmps = presentation.getThumbnails(options, new int[] { 2, 7 });
}finally {
    presentation.dispose();
}

The following methods have been added to the Slides class and ISlides interface:

public java.awt.image.BufferedImage getThumbnail(INotesCommentsLayoutingOptions notesCommentsLayouting);
public java.awt.image.BufferedImage getThumbnail(INotesCommentsLayoutingOptions notesCommentsLayouting, float scaleX, float scaleY);
public java.awt.image.BufferedImage getThumbnail(INotesCommentsLayoutingOptions notesCommentsLayouting,java.awt.Dimension imageSize);
public void renderToGraphics(INotesCommentsLayoutingOptions notesCommentsLayouting,java.awt.Graphics2D graphics, int width, int height);
public void renderToGraphics(INotesCommentsLayoutingOptions notesCommentsLayouting,java.awt.Graphics2D graphics, float scale);
public void renderToGraphics(INotesCommentsLayoutingOptions notesCommentsLayouting,java.awt.Graphics2D graphics);

For example, to get an image of the third presentation slide with the comments displayed on the right, you can use the following code:

Presentation presentation = new Presentation("Presentation.pptx");
try{
    NotesCommentsLayoutingOptions options = new NotesCommentsLayoutingOptions();
    options.setCommentsPosition(CommentsPositions.Right);

    BufferedImage bmp = presentation.getSlides().get_Item(2).getThumbnail(options);
}finally {
    presentation.dispose();
}

Note that the getThumbnail and renderToGraphics methods of the Slide class can throw an exception of type InvalidOperationException if the notesCommentsLayouting.setNotesPosition() method takes the value NotesPositions.BottomFull. This is due to the fact that the notes may be too long and go beyond the page.

Methods renderToGraphics (bool withNotes, Graphics graphics, int width, int height), renderToGraphics (bool withNotes, Graphics graphics, float scale) and renderToGraphics (bool withNotes, Graphics graphics) of the Slides class and methods getThumbnail (float scaleX, float scaleY), getThumbnail (Dimension imageSize) of the NotesSlide class are marked as obsolete now.