Browse our Products

Aspose.Words for .NET 23.3 Release Notes

Major Features

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

  • Extended set of public properties for working with fill colors.
  • Implemented rendering of radial gradients with SkiaSharp native shader for .NET Standard.
  • Added support of InvertIfNegative property for bar chart rendering.
  • Implemented saving progress notifications for MOBI and AZW3 formats.
  • Added an ability to specify whether to adjust sentence and word spacing automatically upon document import.

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 23.3. 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 public properties for working with fill colors

Related issue: WORDSNET-24442

A new public properties ForeThemeColor and BackThemeColor has been added to the Fill class:

/// <summary>
/// Gets or sets a ThemeColor object that represents the foreground color for the fill.
/// </summary>
public ThemeColor ForeThemeColor { get; set; }

/// <summary>
/// Gets or sets a ThemeColor object that represents the background color for the fill.
/// </summary>
public ThemeColor BackThemeColor { get; set; }

A new public properties ForeTintAndShade and BackTintAndShade has been added to the Fill class:

/// <summary>
/// Gets or sets a double value that lightens or darkens the foreground color.
/// </summary>
/// <remarks>
/// <para> The allowed values are within the range from -1 (the darkest) to 1 (the lightest) for this property.
/// Zero (0) is neutral. Attempting to set this property to a value less than -1 or more than 1
/// results in <see cref="ArgumentOutOfRangeException"/>.</para>
/// </remarks>
public double ForeTintAndShade { get; set; }

/// <summary>
/// Gets or sets a double value that lightens or darkens the background color.
/// </summary>
/// <remarks>
/// <para> The allowed values are within the range from -1 (the darkest) to 1 (the lightest) for this property.
/// Zero (0) is neutral. Attempting to set this property to a value less than -1 or more than 1
/// results in <see cref="ArgumentOutOfRangeException"/>.</para>
/// </remarks>
public double BackTintAndShade { get; set; }
Document doc = new Document("in.docx");

Fill shapeFill = (doc.GetChild(NodeType.Shape, 0, true) as Shape).Fill;
// Gets and sets the value of theme colors.
if (shapeFill.ForeThemeColor == ThemeColor.Accent1)
    shapeFill.ForeThemeColor = ThemeColor.Dark1;

if (shapeFill.BackThemeColor == ThemeColor.Accent2)
    shapeFill.BackThemeColor = ThemeColor.Dark2;

Fill textFill1 = doc.FirstSection.Body.FirstParagraph.Runs[0].Font.Fill;
// Gets and sets the tint value.
if (textFill1.ForeTintAndShade == 0)
    textFill1.ForeTintAndShade = 0.5;

Fill textFill2 = doc.FirstSection.Body.FirstParagraph.Runs[1].Font.Fill;
// Gets and sets the shade value.
if (textFill2.ForeTintAndShade == 0)
    textFill2.ForeTintAndShade = -0.2;

doc.Save("out.docx");

Added public properties HasMajorGridlines and HasMinorGridlines to ChartAxis class

Related issue: WORDSNET-24673

The following public properties have been added to the Aspose.Words.Drawing.Charts.ChartAxis class:

/// <summary>
/// Gets or sets a flag indicating whether the axis has major gridlines.
/// </summary>
public bool HasMajorGridlines { get; set; }

/// <summary>
/// Gets or sets a flag indicating whether the axis has minor gridlines.
/// </summary>
public bool HasMinorGridlines { get; set; }

Explains how to show chart gridlines.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert a chart.
Shape shape = builder.InsertChart(ChartType.Column, 432, 252);

ChartAxis xAxis = shape.Chart.AxisX;
ChartAxis yAxis = shape.Chart.AxisY;

// Show gridlines.
xAxis.HasMajorGridlines = true;
xAxis.HasMinorGridlines = true;
yAxis.HasMajorGridlines = true;
yAxis.HasMinorGridlines = true;

doc.Save("Gridlines.docx");

Added public property ImportFormatOptions.AdjustSentenceAndWordSpacing

Related issue: WORDSNET-24960

The following public property was added to the Aspose.Words.ImportFormatOptions class:

/// <summary>
/// Gets or sets a boolean value that specifies whether to adjust sentence and word spacing automatically.
/// The default value is <c>false</c>.
/// </summary>
public bool AdjustSentenceAndWordSpacing { get; set; }
Document srcDoc = new Document();
Document dstDoc = new Document();

DocumentBuilder builder = new DocumentBuilder(srcDoc);
builder.Write("Dolor sit amet.");

builder = new DocumentBuilder(dstDoc);
builder.Write("Lorem ipsum.");

ImportFormatOptions options = new ImportFormatOptions() { AdjustSentenceAndWordSpacing = true };
builder.InsertDocument(srcDoc, ImportFormatMode.UseDestinationStyles, options);

Console.WriteLine(dstDoc.FirstSection.Body.FirstParagraph.GetText());

/* This code produces the following output (please note the additional ' ' space character just before pasted content):
Lorem ipsum. Dolor sit amet.
*/

Added public property TextBox.NoTextRotation

Related issue: WORDSNET-24883

The following public property was added to the Aspose.Words.Drawing.TextBox class:

/// <summary>
/// Gets or sets a boolean value indicating either text of the TextBox should not rotate when the shape is rotated.
/// </summary>
/// <remarks>
/// <p>The default value is <c>false</c></p>
/// </remarks>
public bool NoTextRotation
DocumentBuilder builder = new DocumentBuilder();
Shape shape = builder.InsertShape(ShapeType.Ellipse, 20, 20);
shape.TextBox.NoTextRotation = true;

Enabled saving progress notifications for MOBI and AZW3 formats

Related issue: WORDSNET-24900

The SaveOptions.ProgressCallback is now also invoked when saving to Mobi or AZW3.