Browse our Products

Aspose.Words for .NET 19.11 Release Notes

Major Features

  • Provided an ability to work with Web Extensions, new classes allow to customize elements and attributes that extend the XML vocabulary for Office Add-ins representation.
  • Added an ability to customize the formatting of the horizontal rule shape.
  • Improved character spacing calculation when ‘use printer metrics’ option is set.
  • Macros support improved.

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
WORDSNET-18890Consider support ECSDANew Feature
WORDSNET-18182Add feature to set properties of horizontal ruleNew Feature
WORDSNET-19023Throw warnings about the presence of JavaScript (or any other unsupported Scripts) in HTMLNew Feature
WORDSNET-19152Support of .NET Core 3.0 in Aspose.WordsNew Feature
WORDSNET-19197Implement EMF compound lines rendering to PDF - DOCX to PDF conversion issue with Shape renderingNew Feature
WORDSNET-19280Add support for extraction MOL files from OLE objectNew Feature
WORDSNET-18681Support for adding dynamic WebExtension element nodes in Word DocumentNew Feature
WORDSNET-19363Implement unified EMF complex paths renderingNew Feature
WORDSNET-6035Create documentation for using temporary folder on saveEnhancement
WORDSNET-10301Add feature to edit macros of a documentEnhancement
WORDSNET-11177Consider adding an ability to read/add/edit/delete macros in documentsEnhancement
WORDSNET-13121Insert Macro into a DocumentEnhancement
WORDSNET-19153Improve a VBAProject class to be able to read all project content into the document modelEnhancement
WORDSNET-19198Border of boxes in Shape is changed in output PDFEnhancement
WORDSNET-19345Add normalize Istds feature to Document.CleanupBug
WORDSNET-19371The right offset of the chart is changed after converting to PFGBug
WORDSNET-19372Axis title is set. Right and left offsets are changed after converting to PDFBug
WORDSNET-19427System.ArgumentOutOfRangeException occurs upon comparing documentsBug
WORDSNET-19438Range.Bookmarks.Count returns incorrect valueBug
WORDSNET-17906Chart rendered to PDF/HTML does not look the same as the original one in DOCXBug
WORDSNET-19439Paragraph alignment is lost when Range.Replace is used with &pBug
WORDSNET-19308Paragraph break size does not match MS Word in Aspose.Words DOCX, PDF outputBug
WORDSNET-19301DOCX to PDF - hyphenation not sameBug
WORDSNET-18077DOCX to PDF - output chart legend box is biggerBug
WORDSNET-18118DOCX to PDF conversion issue with legendBug
WORDSNET-19007Strikethrough should be rendered over inline picture in compatibility modeBug
WORDSNET-19303Colons on the wrong side of the text after conversion to PDFBug
WORDSNET-11536Table is moved to previous pageBug
WORDSNET-17075Word to RTF conversion with absolute positioned textboxes renders incorrectlyBug
WORDSNET-19382DOC to DOCX lost fontsBug
WORDSNET-19027Image has wrong size after conversionBug
WORDSNET-19239MHT to PDF FileCorruptedException  XMLStreamExceptionBug
WORDSNET-17869Incorrect width of the plot area and the legend after converting to PDFBug
WORDSNET-17781Incorrect rendering of legend markers after converting to PDFBug
WORDSNET-17816MailMerge.Execute does not update the IF fieldBug
WORDSNET-19389Aspose.Words.FileCorruptedException is thrown while loading DOCXBug
WORDSNET-19241SVG image distorted in documentBug
WORDSNET-19392System.OverflowException is thrown while loading DOCXBug
WORDSNET-17779Text of legend items is clipped after converting to PDFBug
WORDSNET-18947DOCX to PDF conversion issue with page number renderingBug
WORDSNET-19398PageCount returns the wrong value and after the UpdatePageLayout it increasesBug
WORDSNET-19187VbaModule.SourceCode does not update the VBA codeBug
WORDSNET-19401Document.Save throws System.InvalidOperationExceptionBug
WORDSNET-19271Font color changes while Word document is saved as PDFBug
WORDSNET-19209UpdateFields does not calculate SUM inside FORMTEXTBug
WORDSNET-18973Check suspicious code found by PVS studioBug
WORDSNET-18764DOC to PDF conversion issue with flow chart renderingBug
WORDSNET-18855Remove the MailMergeRtlCleanupMode enumBug
WORDSNET-19396On conversion to PDF the code throws NullReferenceException when MemoryOptimization is set to trueBug
WORDSNET-18768Incorrect placement of the legend items after converting to PDFBug
WORDSNET-19306Hidden data is displayed on conversion DOC to TIFFBug
WORDSNET-19304After conversion to PDF one more page added, and wrong page number on the first pageBug
WORDSNET-19310NumberFormat.FormatCode resets after applying NumberFormat.IsLinkedToSourceBug
WORDSNET-19069NullReferenceException when saving DOCX to PDF with MemoryOptimization enabledBug
WORDSNET-19314The issue with the graph’s legends after conversion DOCX to PDFBug
WORDSNET-19313DOC to Fixed page format conversion issue with page headerBug
WORDSNET-19316Numbering disappear during appending documentsBug
WORDSNET-19318DOC to DOCX lost fontsBug
WORDSNET-19076Text is rendered outside the table’s cell in output PDFBug
WORDSNET-19324Inconsistent behavior of FormatterPal.TryParseIntBug
WORDSNET-19326Table loses conditional formatting for cellBug
WORDSNET-19327Aspose.Words.FileCorruptedException occurs upon loading a DOCBug
WORDSNET-19339BuiltInDocumentProperties.Words returns incorrect words count for ChineseBug
WORDSNET-19298Exception is thrown when updating word page layoutBug
WORDSNET-19341Font AltName is not written when Aspose.Words is running on LinuxBug
WORDSNET-19328Aspose.Words.FileCorruptedException occurs upon loading a DOCBug
WORDSNET-19351List number does not restart when document is inserted using InsertDocument methodBug
WORDSNET-19353Aspose.Words.FileCorruptedException occurs on loading a DOCX fileBug
WORDSNET-19168SmartArt to PNG conversion issue with text renderingBug
WORDSNET-19346Font of content control is changed after convesion from DOCX to HTMLBug
WORDSNET-19299Tables incorrectly split after UpdatePageLayoutBug
WORDSNET-12684Shape’s text position is changed in output PDFBug
WORDSNET-19384Analyze what it takes to work License.SetLicense with .NET Core 2.2Bug
WORDSNET-13190Chinese text moves to next line after conversion from DOCX to PDFBug
WORDSNET-9076Empty spaces appear after conversion from DOC to HTMLBug
WORDSNET-13414Table’s rows are moved to previous page in output PDFBug
WORDSNET-13488Google translate shows different result for Aspose.Words generated PDF contentBug
WORDSNET-13053Chinese text moves to next lines at each page of TIFF/PDFBug
WORDSNET-12697Cell’s text is truncated after saving DOCX to PDFBug
WORDSNET-12420DOC to PDF conversion issue with image renderingBug
WORDSNET-12506The page layout of Chinese text is not correct in output PDFBug

Public API and Backward Incompatible Changes

This section lists public API changes that were introduced in Aspose.Words 19.11. 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 support for Web extension elements

Following public classes and enums were added.

/// <summary>
/// Represents an add-in task pane object.
/// </summary>
public class TaskPane
{
    /// <summary>
    /// Creates task pane add-in instance.
    /// </summary>
    public TaskPane() { }
    /// <summary>
    /// Specifies the index, enumerating from the outside to the inside, of this task pane among other persisted
    /// task panes docked in the same default location.
    /// </summary>
    public int Row { get; set; }
    /// <summary>
    /// Specifies the default width value for this task pane instance.
    /// </summary>
    public double Width { get; set; }
    /// <summary>
    /// Specifies whether the task pane is locked to the document in the UI and cannot be closed by the user.
    /// </summary>
    public bool IsLocked { get; set; }
    /// <summary>
    /// Specifies whether the task pane shows as visible by default when the document opens.
    /// </summary>
    public bool IsVisible { get; set; }
    /// <summary>
    /// Specifies the last-docked location of this task pane object.
    /// </summary>
    /// <dev>In the spec this value represents as string.</dev>
    public TaskPaneDockState DockState { get; set; }
    /// <summary>
    /// Represents an web extension object.
    /// </summary>
    public WebExtension WebExtension { get; }
}
/// <summary>
/// Specifies a list of persisted task pane objects.
/// </summary>
public class TaskPaneCollection
{
    /// <summary>
    /// Gets the number of elements contained in the collection.
    /// </summary>
    public int Count;
    /// <summary>
    /// Gets or sets an item at the specified index.
    /// </summary>
    /// <param name="index">Zero-based index of the item.</param>
    public T this[int index] { get; set; }
    /// <summary>
    /// Adds specified item to the collection.
    /// </summary>
    /// <param name="item">Item for adding.</param>
    public void Add(T item);
    /// <summary>
    /// Removes all elements from the collection.
    /// </summary>
    public void Clear();
    /// <summary>
    /// Removes the item at the specified index from the collection.
    /// </summary>
    /// <param name="index">The zero-based index of the collection item.</param>
    public void Remove(int index);
}
/// <summary>
/// Represents a web extension object.
/// </summary>
public class WebExtension
{
    /// <summary>
    /// Uniquely identifies the web extension instance in the current document.
    /// </summary>
    public string Id { get; set; }
    /// <summary>
    /// Specifies whether the user can interact with the web extension or not.
    /// </summary>
    public bool IsFrozen { get; set; }
    /// <summary>
    /// Specifies the primary reference to an web extension.
    /// </summary>
    public WebExtensionReference Reference { get; }
    /// <summary>
    /// Specifies a list of web extension bindings.
    /// </summary>
    public WebExtensionBindingCollection Bindings { get; }
    /// <summary>
    /// Specifies alternate references to a web extension.
    /// </summary>
    public WebExtensionReferenceCollection AlternateReferences { get; }
    /// <summary>
    /// Represents a set of web extension custom properties.
    /// </summary>
    public WebExtensionPropertyCollection Properties { get; }
}
/// <summary>
/// Specifies a binding relationship between a web extension and the data in the document.
/// </summary>
public class WebExtensionBinding
{
    /// <summary>
    /// Creates web extension binding with specified parameters.
    /// </summary>
    /// <param name="id">Binding identifier.</param>
    /// <param name="bindingType">Binding type.</param>
    /// <param name="appRef">Binding key used to map the binding entry in this list with the bound data in the document.</param>
    public WebExtensionBinding(string id, WebExtensionBindingType bindingType, string appRef);
    /// <summary>
    /// Specifies the binding identifier.
    /// </summary>
    public string Id { get; set; }
    /// <summary>
    /// Specifies the binding type.
    /// </summary>
    public WebExtensionBindingType BindingType { get; set; }
    /// <summary>
    /// Specifies the binding key used to map the binding entry in this list with the bound data in the document.
    /// </summary>
    /// <dev>It may be, for example, identifier of the SDT.</dev>
    public string AppRef { get; set; }
}
/// <summary>
/// Specifies a web extension custom property.
/// </summary>
public class WebExtensionProperty
{
    /// <summary>
    /// Creates web extension custom property with specified name and value.
    /// </summary>
    /// <param name="name">Property name.</param>
    /// <param name="value">Property value.</param>
    public WebExtensionProperty(string name, string value);
    /// <summary>
    ///  Specifies a custom property name
    /// </summary>
    public string Name { get; set; }
    /// <summary>
    ///  Specifies a custom property value.
    /// </summary>
    public string Value { get; set; }
}
/// <summary>
/// Represents the reference to a web extension. The reference is used to identify the provider location and version of the
/// extension.
/// </summary>
public class WebExtensionReference
{
    /// <summary>
    /// Creates instance of the reference to a web extension.
    /// </summary>
    public WebExtensionReference();
    /// <summary>
    /// Identifier associated with the web extension within a catalog provider.
    /// </summary>
    public string Id { get; set; }
    /// <summary>
    /// Specifies the version of the web extension.
    /// </summary>
    public string Version { get; set; }
    /// <summary>
    ///  Specifies the instance of the marketplace where the web extension is stored.
    /// </summary>
    public string Store { get; set; }
    /// <summary>
    /// Specifies the type of marketplace.
    /// </summary>
    public WebExtensionStoreType StoreType { get; set; }
}
/// <summary>
/// Specifies a list of web extension bindings.
/// </summary>
public class WebExtensionBindingCollection
{
    /// <summary>
    /// Gets the number of elements contained in the collection.
    /// </summary>
    public int Count { get; }
    /// <summary>
    /// Gets or sets an item at the specified index.
    /// </summary>
    /// <param name="index">Zero-based index of the item.</param>
    public T this[int index] { get; set; }
    /// <summary>
    /// Adds specified item to the collection.
    /// </summary>
    /// <param name="item">Item for adding.</param>
    public void Add(T item);
    /// <summary>
    /// Removes all elements from the collection.
    /// </summary>
    public void Clear();
    /// <summary>
    /// Removes the item at the specified index from the collection.
    /// </summary>
    /// <param name="index">The zero-based index of the collection item.</param>
    public void Remove(int index);
}
/// <summary>
/// Specifies a set of web extension custom properties.
/// </summary>
public class WebExtensionPropertyCollection
{
    /// <summary>
    /// Gets the number of elements contained in the collection.
    /// </summary>
    public int Count { get; }
    /// <summary>
    /// Gets or sets an item at the specified index.
    /// </summary>
    /// <param name="index">Zero-based index of the item.</param>
    public T this[int index] { get; set; }
    /// <summary>
    /// Adds specified item to the collection.
    /// </summary>
    /// <param name="item">Item for adding.</param>
    public void Add(T item);
    /// <summary>
    /// Removes all elements from the collection.
    /// </summary>
    public void Clear();
    /// <summary>
    /// Removes the item at the specified index from the collection.
    /// </summary>
    /// <param name="index">The zero-based index of the collection item.</param>
    public void Remove(int index);
}
/// <summary>
/// Specifies a list of web extension references.
/// </summary>
public class WebExtensionReferenceCollection
{
    /// <summary>
    /// Gets the number of elements contained in the collection.
    /// </summary>
    public int Count { get; }
    /// <summary>
    /// Gets or sets an item at the specified index.
    /// </summary>
    /// <param name="index">Zero-based index of the item.</param>
    public T this[int index] { get; set; }
    /// <summary>
    /// Adds specified item to the collection.
    /// </summary>
    /// <param name="item">Item for adding.</param>
    public void Add(T item);
    /// <summary>
    /// Removes all elements from the collection.
    /// </summary>
    public void Clear();
    /// <summary>
    /// Removes the item at the specified index from the collection.
    /// </summary>
    /// <param name="index">The zero-based index of the collection item.</param>
    public void Remove(int index);
}
/// <summary>
/// Enumerates available locations of task pane object.
/// </summary>
public enum TaskPaneDockState
{
    Right,
    Left
}
/// <summary>
/// Enumerates available types of binding between a web extension and the data in the document.
/// </summary>
public enum WebExtensionBindingType
{
    /// <summary>
    /// Tabular data without a header row.
    /// </summary>
    Matrix,
    /// <summary>
    /// Tabular data with a header row.
    /// </summary>
    Table,
    /// <summary>
    /// Plain text.
    /// </summary>
    Text,
    Default = Matrix
}
/// <summary>
/// Enumerates available types of a web extension store.
/// </summary>
public enum WebExtensionStoreType
{
    SPCatalog,
    OMEX,
    SPApp,
    Exchange,
    FileSystem,
    Registry,
    ExCatalog,
    Default = SPCatalog
}

Typical Use Case.

Document doc = new Document();
TaskPane taskPane = new TaskPane();
doc.WebExtensionTaskPanes.Add(taskPane);
taskPane.DockState = TaskPaneDockState.Right;
taskPane.IsVisible = true;
taskPane.Width = 300;
taskPane.WebExtension.Reference.Id = "wa102923726";
taskPane.WebExtension.Reference.Version = "1.0.0.0";
taskPane.WebExtension.Reference.StoreType = WebExtensionStoreType.OMEX;
taskPane.WebExtension.Reference.Store = "th-TH";
taskPane.WebExtension.Properties.Add(new WebExtensionProperty("mailchimpCampaign", "mailchimpCampaign"));
taskPane.WebExtension.Bindings.Add(new WebExtensionBinding("UnnamedBinding_0_1506535429545", WebExtensionBindingType.Text, "194740422"));

Horizontal rule formatting

Related issue: WORDSNET-18182

Added new public property Shape.HorizontalRuleFormat

/// <summary>
/// Provides access to the properties of the horizontal rule shape.
/// For a shape that is not a horizontal rule, returns null.
/// </summary>
public HorizontalRuleFormat HorizontalRuleFormat

Added new public class HorizontalRuleFormat HorizontalRuleFormat class allows to fully customize the formatting of the horizontal rule. This class can only be obtained through the Shape.HorizontRuleFormat property.

/// <summary>
/// Represents horizontal rule formatting.
/// </summary>
public class HorizontalRuleFormat
{
    /// <summary>
    /// Gets or sets the length of the specified horizontal rule expressed as a percentage of the window width.
    /// </summary>
    /// <remarks>
    /// <p>Valid values range from 1 to 100 inclusive.</p>
    /// <p>The default value is 100.</p>
    /// </remarks>
    /// <exception cref="ArgumentOutOfRangeException">
    /// Throws when argument was out of the range of valid values.
    /// </exception>
    public double WidthPercent
    {
        get; set;
    }
    /// <summary>
    /// Gets or sets the height of the horizontal rule.
    /// </summary>
    /// <remarks>
    /// <p>This is a shortcut to the <see cref="Aspose.Words.Drawing.ShapeBase.Height"/> property.</p>
    /// <p>Valid values range from 0 to 1584 inclusive.</p>
    /// <p>The default value is 1.5.</p>
    /// </remarks>
    /// <exception cref="ArgumentOutOfRangeException">
    /// Throws when argument was out of the range of valid values.
    /// </exception>
    public double Height
    {
        get; set;
    }
    /// <summary>
    /// Indicates the presence of 3D shading for the horizontal rule.
    /// If true, then the horizontal rule is without 3D shading and solid color is used.
    /// </summary>
    /// <remarks>
    /// <p>The default value is false.</p>
    /// </remarks>
    public bool NoShade
    {
        get; set;
    }
    /// <summary>
    /// Gets or sets the brush color that fills the horizontal rule.
    /// </summary>
    /// <remarks>
    /// <p>This is a shortcut to the <see cref="Aspose.Words.Drawing.Fill.Color"/> property.</p>
    /// <p>The default value is 
    /// <ms><see cref="System.Drawing.Color.Gray"/>.</ms>
    /// <java><see javaref="T:java.awt.Color.GRAY"/>.</java>
    /// </p>
    /// </remarks>
    public Color Color
    {
        get; set;
    }
    /// <summary>
    /// Gets or sets the alignment of the horizontal rule.
    /// </summary>
    /// <remarks>
    /// <p>The default value is <see cref="HorizontalRuleAlignment.Left"/>.</p>
    /// </remarks>
    public HorizontalRuleAlignment Alignment
    {
        get; set;
    }
}

Added public enum HorizontalRuleAlignment

/// <summary>
/// Represents the alignment for the specified horizontal rule. 
/// </summary>
public enum HorizontalRuleAlignment

Use Case:

DocumentBuilder builder = new DocumentBuilder();
Shape shape = builder.InsertHorizontalRule();
HorizontalRuleFormat horizontalRuleFormat = shape.HorizontalRuleFormat;
horizontalRuleFormat.Alignment = HorizontalRuleAlignment.Center;
horizontalRuleFormat.WidthPercent = 70;
horizontalRuleFormat.Height = 3;
horizontalRuleFormat.Color = Color.Blue;
horizontalRuleFormat.NoShade = true;
builder.Document.Save("HorizontalRuleFormat.docx");

Macros support improved

Related issue: WORDSNET-19153

Added a new public setter for a Document.VbaProject

/// <summary>
/// Gets or sets a <see cref="VbaProject" />.
/// </summary>
public VbaProject VbaProject
Added a new public constructor for a VbaProject class.
/// <summary>
/// Creates a blank VbaProject.
/// </summary>
public VbaProject()
Added a new public setter for a VbaProject.Name
/// <summary>
/// Gets or sets VBA project name.
/// </summary>
public string Name
Added a new public getter for a VbaProject.CodePage
/// <summary>
/// Returns the VBA project’s code page.
/// </summary>
public int CodePage
Added a new public constructor for a VbaModule class.
/// <summary>
/// Creates an empty module.
/// </summary>
public VbaModule()
Added a new public setter for a VbaModule.Name
/// <summary>
/// Gets or sets VBA project module name.
/// </summary>
public string Name
Added a new public property VbaModule.Type
/// <summary>
/// Specifies whether the module is a procedural module, document module, class module, or designer module.
/// </summary>
public VbaModuleType Type
Added a new public void VbaModuleCollection.Add(VbaModule vbaModule)
/// <summary>
/// Adds a module to the collection.
/// </summary>
public void Add(VbaModule vbaModule)
Added a new public void VbaModuleCollection.Remove(VbaModule vbaModule)
/// <summary>
/// Removes the specified module from the collection.
/// </summary>
/// <param name="module">The module to remove.</param>
public void Remove(VbaModule module)
Added ability to retrieve a module from the VbaModuleCollection by name.
/// <summary>
/// Retrieves a <see cref="VbaModule"/> object by name, or Null if not found.
/// </summary>
public VbaModule this[string name]
Added a new public property VbaModuleCollection.Count
/// <summary>
/// Returns the number of VBA modules in the collection.
/// </summary>
public int Count
Added public enums for specifying a VbaModule type.
/// <summary>
/// Specifies the type of a model in a VBA project.
/// </summary>
public enum VbaModuleType
{
  /// <summary>
  /// Specifies a module that extends a document module.
  /// </summary>
  DocumentModule,
  /// <summary>
  /// Specifies a procedural module.
  /// </summary>
  ProceduralModule,
  /// <summary>
  /// Specifies a class module.
  /// </summary>
  ClassModule,
  /// <summary>
  /// Specifies a designer module.
  /// </summary>
  DesignerModule
}
Use Case: Explains how to create a VbaProject from a scratch, create a VbaModules from a scratch and add it to the project.
Document doc = new Document();

// Create a new VBA project.
VbaProject project = new VbaProject();
project.Name = "AsposeProject";
doc.VbaProject = project;

// Create a new module and specify a macro source code.
VbaModule module = new VbaModule();
module.Name = "AsposeModule";
module.Type = VbaModuleType.ProceduralModule;
module.SourceCode = "New source code";

// Add module to the VBA project.
doc.VbaProject.Modules.Add(module);

Obsolete enum Aspose.Words.MailMerging.MailMergeRtlCleanupMode was removed

Obsolete enum Aspose.Words.MailMerging.MailMergeRtlCleanupMode was removed.