Browse our Products

Aspose.Words for Java 25.1 Release Notes

Major Features

There are 91 improvements and fixes in this regular monthly release. The most notable are:

  • Legacy HarfBuzz jar Create legacy HarfBuzz jar and update maven dependency.
  • Enhanced HTML/SVG Saving: Added IdPrefix and RemoveJavaScriptFromLinks options to both HtmlFixedSaveOptions and SvgSaveOptions.
  • AI Grammar Checking: Enabled grammar checking functionality using OpenAI.
  • Advanced Markdown Options: Added options to set image resolution and OfficeMath output mode in MarkdownSaveOptions.

Full List of Issues Covering all Changes in this Release

Public API and Backward Incompatible Changes

This section lists public API changes that were introduced in Aspose.Words 25.1. It includes not only new and obsoleted public methods, but also a description of any changes in the behavior behind the scenes in Aspose.Words which may affect existing code. Any behavior introduced that could be seen as regression and modifies the existing behavior is especially important and is documented here.

Added new maven dependency to legacy HarfBuzz jar

Related issue: WORDSJAVA-3018 WORDSJAVA-3019

A new public maven dependency for legacy HarfBuzz jar:

        <dependency>
            <groupId>com.aspose</groupId>
            <artifactId>aspose-words</artifactId>
            <version>25.1</version>
            <classifier>shaping-harfbuzz-legacy-plugin</classifier>
        </dependency>

Added new public option HtmlFixedSaveOptions.IdPrefix and SvgSaveOptions.IdPrefix

Related issue: WORDSNET-27277

A new public option IdPrefix has been added in HtmlFixedSaveOptions and SvgSaveOptions classes:

/// <summary>
/// Specifies a prefix that is prepended to all generated element IDs in the output document.
/// Default value is null and no prefix is prepended.
/// </summary>
/// <remarks>
/// If the prefix is specified, it can contain only letters, digits, underscores, and hyphens,
/// and must start with a letter.
/// </remarks>
/// <exception cref="ArgumentException">The value does not meet the requirements specified above.</exception>
public string IdPrefix
{
    get { return mIdPrefix; }
    set
    {
        AssertValidIdPrefix(value);
        mIdPrefix = value;
    }
}

This use case explains how to specify a prefix that is prepended to all generated element IDs in the output HTML document:

This use case explains how to specify a prefix that is prepended to all generated element IDs in the output SVG document:

Related issue: WORDSNET-27520

A new public option RemoveJavaScriptFromLinks has been added in HtmlFixedSaveOptions and SvgSaveOptions classes:

/// Specifies whether JavaScript will be removed from links.
/// Default is <c>false</c>.
/// If this option is enabled, all links containing JavaScript will be replaced with "javascript:void(0)".
/// </summary>
public bool RemoveJavaScriptFromLinks { get; set; }

This use case explains how to specify whether JavaScript will be removed from links:

Added possibility to check Grammar using OpenAi

Related issue: WORDSNET-27676

Added a new public method into Aspose.Words.AI.IAiModelText interface:

/// <summary>
/// Checks grammar of the provided document.
/// This operation leverages the connected AI model for checking grammar of document.
/// </summary>
/// <param name="sourceDocument">The document being checked for grammar.</param>
/// <param name="options">Optional settings to control how grammar will be checked.</param>
/// <returns>A new <see cref="Document"/> with checked grammar.</returns>
Document CheckGrammar(Document sourceDocument, CheckGrammarOptions options = null);

Also, added a new public class into Aspose.Words.AI namespace:

/// <summary>
/// Allows to specify various options while checking grammar of a document using AI.
/// </summary>
public class CheckGrammarOptions

This use case explains how to check grammar of a document using OpenAi generative model with revisions:

Added possibility to set image resolution in MarkdownSaveOptions

Related issue: WORDSNET-27675

Added a new public property into Aspose.Words.Saving.MarkdownSaveOptions class:

/// <summary>
/// Specifies the output resolution for images when exporting to Markdown.
/// Default is <c>96 dpi</c>.
/// </summary>
public int ImageResolution

This use case explains how to specify image resolution while exporting to Markdown:

Added possibility to set OfficeMath output mode in MarkdownSaveOptions

Related issue: WORDSNET-27646

Implemented new public member in Aspose.Words.Saving.MarkdownSaveOptions class:

/// <summary>
/// Specifies how OfficeMath will be written to the output file.
/// Default value is <see cref="MarkdownOfficeMathExportMode.Text"/>.
/// </summary>
public MarkdownOfficeMathExportMode OfficeMathExportMode { get; set; }

and corresponding public enumeration in Aspose.Words.Saving namespace:

/// <summary>
/// Specifies how Aspose.Words exports OfficeMath to Markdown.
/// </summary>
public enum MarkdownOfficeMathExportMode

This use case explains how to export OfficeMath as an image to Markdown: