Browse our Products

Aspose.Words for Java 24.2 Release Notes

Major Features

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

  • Introduced new public properties for enhanced style management.
  • Added the capability to specify SvgSaveOptions during rendering using ShapeRenderer.Save() and OfficeMathRenderer.Save() methods.
  • Enhanced functionality to retrieve the actual text of reference marks for footnotes and endnotes.
  • Continued extending the DrawingML Chart API capabilities.
  • Added an ability to preserve empty lines while loading Markdown files.
  • Enabled compatibility with Word 2016 charts for LINQ Reporting Engine.

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 24.2. 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 an ability to preserve empty lines while loading Markdown files.

Related issue: WORDSNET-26064

Implemented new public classes with a new public property:

/// <summary>
/// Allows to specify additional options when loading <see cref="LoadFormat.Markdown"/> document into a <see cref="Document"/> object.
/// </summary>
public class MarkdownLoadOptions : LoadOptions
...
/// <summary>
/// Gets or sets a boolean value indicating whether to preserve empty lines while load a <see cref="LoadFormat.Markdown"/> document.
/// The default value is <c>false</c>.
/// <para>
/// Normally, empty lines between block-level elements in Markdown are ignored. Empty lines at the beginning and
/// end of the document are also ignored. This option allows to import such empty lines.
/// </para>
/// </summary>
public bool PreserveEmptyLines { get; set; }

This use case explains how to preserve empty lines while loading Markdown document:

Introduced new public properties for enhanced style management.

Related issue: WORDSNET-23973

A new public properties Priority, UnhideWhenUsed and SemiHidden has been added to class Style.

/// <summary>
/// Gets/sets the integer value that represents the priority for sorting the styles in the Styles task pane.
/// </summary>
public int Priority { get; set; }

/// <summary>
/// Gets/sets whether the style used in the current document unhides from the Styles gallery and from the Styles task pane.
/// </summary>
public bool UnhideWhenUsed { get; set; }

/// <summary>
/// Gets/sets whether the style hides from the Styles gallery and from the Styles task pane.
/// </summary>
public bool SemiHidden { get; set; }

This use case explains how to work with new properties:

Added NodeRendererBase.Save() methods that accept SvgSaveOptions.

Related issue: WORDSNET-23355

New public methods has been added to class NodeRendererBase allowing to pass SvgSaveOptions:

/// <summary>
/// Renders the shape into an SVG image and saves into a file.
/// </summary>
/// <param name="fileName">The name for the image file. If a file with the specified name already exists, the existing file is overwritten.</param>
/// <param name="saveOptions">Specifies the options that control how the shape is rendered and saved. Can be <c>null</c>.</param>
public void Save(String fileName, SvgSaveOptions saveOptions);

/// <summary>
/// Renders the shape into an SVG image and saves into a stream.
/// </summary>
/// <param name="stream">The stream where to save the SVG image of the shape.</param>
/// <param name="saveOptions">Specifies the options that control how the shape is rendered and saved. Can be <c>null</c>.
/// If this is <c>null</c>, the image will be saved with the default options.</param>
public void Save(Stream stream, SvgSaveOptions saveOptions);

This use case explains how to specify SvgSaveOptions when rendering via ShapeRenderer.Save() and OfficeMathRenderer.Save() methods:

Added public property Appearance to the StructuredDocumentTagRangeStart class.

Related issue: WORDSNET-26434

A new public property Appearance has been added to class StructuredDocumentTagRangeStart and IStructuredDocumentTag interface:

/// <summary>
/// Gets or sets the appearance of the structured document tag.
/// </summary>
public SdtAppearance Appearance { get; set; }

This use case explains how to get and set Appearance property of a ranged structured document tag:

Added public property Footnote.ActualReferenceMark and public method Document.UpdateActualReferenceMarks.

Related issue: WORDSNET-24512

An ability to get the actual text of reference marks for footnotes and endnotes has been implemented.

The following new public members have been added to the Footnote and Document classes:

public class Footnote
{
    /// <summary>
    /// Gets the actual text of the reference mark displayed in the document for this footnote.
    /// </summary>
    /// <remarks>
    /// To initially populate values of this property for all reference marks of the document, or to update
    /// the values after changes in the document that might affect the reference marks, you must execute the
    /// <see cref="Document.UpdateActualReferenceMarks"/> method.
    /// Updating fields (<see cref="Document.UpdateFields"/>) may also be necessary to get the correct result.
    /// </remarks>
    public string ActualReferenceMark { get; }
    ...
}

public class Document
{
    /// <summary>
    /// Updates the <see cref="Footnote.ActualReferenceMark"/> property of all footnotes and endnotes in the document.
    /// </summary>
    /// <remarks>
    /// Updating fields (<see cref="Document.UpdateFields"/>) may be necessary to get the correct result.
    /// </remarks>
    public void UpdateActualReferenceMarks();

    ...
}

This use case explains how to get actual text of reference mark:

Continued extending the DrawingML Chart API capabilities.

Related issue: WORDSNET-26356

A new class AxisTickLabels has been implemented. The properties related to axis tick mark labels have been marked as obsolete in the ChartAxis class and moved to the new class. A property TickLabels of the AxisTickLabels type has been added to the ChartAxis class.

Also the ability to set font formatting for tick mark labels has been implemented: a new AxisTickLabels.Font property has been added.

And a Format property, which allows defining line formatting for an axis and fill for tick mark labels, has been added to the ChartAxis class.

/// <summary>
/// Represents properties of axis tick mark labels.
/// </summary>
public class AxisTickLabels
{
    /// <summary>
    /// Gets or sets the position of the tick labels on the axis.
    /// </summary>
    /// <remarks>
    /// The property is not supported by MS Office 2016 new charts.
    /// </remarks>
    public AxisTickLabelPosition Position { get; set; }

    /// <summary>
    /// Gets or sets the distance of the tick labels from the axis.
    /// </summary>
    /// <remarks>
    /// <para>The property represents a percentage of the default label offset.</para>
    /// <para>Valid range is from 0 to 1000 percent inclusive. The default value is 100%.</para>
    /// <para>The property has effect only for category axes. It is not supported by MS Office 2016 new charts.</para>
    /// </remarks>
    public int Offset { get; set; }

    /// <summary>
    /// Gets or sets the interval at which the tick labels are drawn.
    /// </summary>
    /// <remarks>
    /// <para>The property has effect for text category and series axes. It is not supported by MS Office 2016 
    /// new charts. Valid range of a value is greater than or equal to 1.</para>
    /// <para>Setting this property sets the <see cref="IsAutoSpacing"/> property to <c>false</c>.</para>
    /// </remarks>
    public int Spacing { get; set; }

    /// <summary>
    /// Gets or sets a flag indicating whether to use automatic interval for drawing the tick labels.
    /// </summary>
    /// <remarks>
    /// <para>The default value is <c>true</c>.</para>
    /// <para>The property has effect for text category and series axes. It is not supported by MS Office 2016
    /// new charts.</para>
    /// </remarks>
    public bool IsAutoSpacing { get; set; }

    /// <summary>
    /// Gets or sets text alignment of the axis tick labels.
    /// </summary>
    /// <remarks>
    /// <para>This property has effect only for multi-line labels.</para>
    /// <para>The default value is <see cref="ParagraphAlignment.Center"/>.</para>.
    /// </remarks>
    public ParagraphAlignment Alignment { get; set; }

    /// <summary>
    /// Provides access to font formatting of the tick labels.
    /// </summary>
    public Font Font { get; }
}

public class ChartAxis
{
    /// <summary>
    /// Provides access to the properties of the axis tick mark labels.
    /// </summary>
    public AxisTickLabels TickLabels { get; }

    /// <summary>
    /// Provides access to line formatting of the axis and fill of the tick labels.
    /// </summary>
    /// <remarks>
    /// Fill of chart tick marks can be changed only for pre Word 2016 charts. Word 2016 charts do not support this.
    /// </remarks>
    public ChartFormat Format { get; }

    [Obsolete("Obsolete, use the TickLabels.Position property instead.")]
    public AxisTickLabelPosition TickLabelPosition { get; set; }

    [Obsolete("Obsolete, use the TickLabels.Offset property instead.")]
    public int TickLabelOffset { get; set; }

    [Obsolete("Obsolete, use the TickLabels.Spacing property instead.")]
    public int TickLabelSpacing { get; set; }

    [Obsolete("Obsolete, use the TickLabels.IsAutoSpacing property instead.")]
    public bool TickLabelSpacingIsAuto { get; set; }

    [Obsolete("Obsolete, use the TickLabels.Alignment property instead.")]
    public ParagraphAlignment TickLabelAlignment { get; set; }

    ...
}

A new public class ChartDataTable has been implemented. A property DataTable of this type has been added to the Chart class:

/// <summary>
/// Allows to specify properties of a chart data table.
/// </summary>
public class ChartDataTable
{
    /// <summary>
    /// Gets or sets a flag indicating whether the data table will be shown for the chart.
    /// Default value is <c>false</c>.
    /// </summary>
    /// <remarks>
    /// The following chart types do not support data tables: Scatter, Pie, Doughnut, Surface, Radar, Treemap,
    /// Sunburst, Histogram, Pareto, Box and Whisker, Waterfall, Funnel, Combo charts that include series of
    /// these types. Showing a data table for the chart types throws a <see cref="InvalidOperationException"/>
    /// exception.
    /// </remarks>
    public bool Show { get; set; }

    /// <summary>
    /// Gets or sets a flag indicating whether legend keys are displayed in the data table.
    /// The default value is <c>true</c>.
    /// </summary>
    public bool HasLegendKeys { get; set; }

    /// <summary>
    /// Gets or sets a flag indicating whether a horizontal border of the data table is displayed.
    /// The default value is <c>true</c>.
    /// </summary>
    public bool HasHorizontalBorder { get; set; }

    /// <summary>
    /// Gets or sets a flag indicating whether a vertical border of the data table is displayed.
    /// The default value is <c>true</c>.
    /// </summary>
    public bool HasVerticalBorder { get; set; }

    /// <summary>
    /// Gets or sets a flag indicating whether an outline border, that is, a border around series and category names,
    /// is displayed.
    /// The default value is <c>true</c>.
    /// </summary>
    public bool HasOutlineBorder { get; set; }

    /// <summary>
    /// Provides access to font formatting of the data table.
    /// </summary>
    public Font Font { get; }

    /// <summary>
    /// Provides access to fill of text background and border formatting of the data table.
    /// </summary>
    public ChartFormat Format { get; }
}

public class Chart
{
    /// <summary>
    /// Provides access to properties of a data table of this chart.
    /// The data table can be shown using the <see cref="ChartDataTable.Show"/> property.
    /// </summary>
    public ChartDataTable DataTable { get; }

    ...
}

This use case explains how show and format chart data table:

Supported working with Word 2016 charts for LINQ Reporting Engine.

Related issue: WORDSNET-23884

Starting from Aspose.Words 24.2, LINQ Reporting Engine supports working with the following Word 2016 chart types:

  • Treemap
  • Sunburst
  • Histogram
  • Box & Whisker
  • Waterfall
  • Funnel
  • Stock

This use case explains how to use Word 2016 charts with Aspose.Words LINQ Reporting Engine: