Work with Word 2013 Documents and Use Variables in LINQ Reporting Engine with Aspose.Words for .NET 17.3.0

Aspose.Words for .NET logo

We are pleased to announce our next version of Aspose.Words 17.3.0. This month’s release contains over 67 useful new features, enhancements and bug fixes. Please see the release notes for more detail. If you are planning to upgrade from an older version of Aspose.Words to the current version, we would strongly suggest you to check the Public API and Backward Incompatible Changes section to know what APIs are changed so far.

Here is a look at just a few of the biggest features and API changes in this month’s release.

  • Full support for Word 2013 documents (roundtrip to/from DOCX)
  • Variables support and more new features are introduced in LINQ Reporting Engine.
  • New Public OfficeMath properties: MathObjectType, Justification, DisplayType
  • The font substitution mechanism improved. Now Aspose.Words evaluate all related fields in FontInfo (Panose, Sig, etc) and finds the closest match among the available font sources.
  • Asian font rendering improved (more precise metrics calculation).
  • Stroke weight is now taken into account while rendering auto-sized Textboxes.
  • Implemented the next round of improvements in the table grid algorithm.
  • Improved table breaking logic in compatibility mode for tables with header rows.
  • Improved table breaking logic for tables with nested tables in a cell with the bottom margin set.
  • Improved tables breaking logic for tables with vertically merged cells having horizontal borders.
  • Implemented fitText option for table cells.

Full Support for Word 2013 Documents

Starting from Aspose.Words 17.3.0, we have added the full support of MS Word 2013 documents. The full support of roundtrip to/from DOCX is available in this Aspose.Words version.

Font Substitution Mechanism Improved

Previously, Aspose.Words performed font substitution only in cases when FontInfo in the document for the missing font doesn’t contain the PANOSE. Now Aspose.Words evaluates all related fields in FontInfo (Panose, Sig etc) and finds the closest match among the available font sources. In case of font substitution the warning is issued with text:

“Font ” has not been found. Using ” font instead. Reason: closest match according to font info from the document.”

Please note that now the font substitution mechanism will override the FontSettings.DefaultFontName in cases when FontInfo for the missing font is available in the document. FontSettings.DefaultFontName will be used only in cases when there are no FontInfo for the missing font.

Moreover, please note that the font substitution algorithm in MS Word is not documented So, the result of Aspose.Words font substitution may not match MS Word choice.

Added a MailMergeCleanupOptions Option to Remove Empty Row

We have introduced MailMergeCleanupOptions.RemoveEmptyTableRows option in Aspose.Words 17.3.0 to remove empty rows that contain mail merge regions from the document. Please refer to the following article:
How to Remove Empty Rows with Cleanup Option

Added Public Property OfficeMath.MathObjectType

We have introduced new property OfficeMath.MathObjectType in Aspose.Words 17.3.0. This property allows users to get type MathObjectType of this Office Math object. The MathObjectType enumeration is added in Aspose.Words 17.3.0 to specify the type of an Office Math object.

OfficeMath officeMath = GetOfficeMath();
if (officeMath.MathObjectType == MathObjectType.Matrix)
   // Do something useful with the Matrix object.

Added Public Properties OfficeMath.Justification and OfficeMath.DisplayType

We have added new public properties Justification and DisplayType into the OfficeMath class. Please refer to the following article for more detail:
Working with OfficeMath

Note that Aspose.Words mimics MS Word behavior. Following is the detail:

  • DisplayType cannot be changed for nested Office Math. The exception will be thrown.
  • Inline justification cannot be set to the Office Math displayed on its own line (DisplayType=OfficeMathDisplayType.Display). The exception will be thrown. OfficeMath.DisplayType property has to be used to change OfficeMathDisplayType first.
  • Justification cannot be set to the Office Math displayed inline with text. The exception will be thrown. OfficeMath.DisplayType property has to be used to change OfficeMathDisplayType first.

Provided Ability to Specify Locale at Field Level

We have added a new public property Field.LocaleId in Aspose.Words 17.3.0 allows users to get/set field’s locale. Please refer to the following article:

/// <summary>
/// Gets or sets LCID of the field.
/// </summary>
/// <seealso cref="FieldUpdateCultureSource.FieldCode"/>
public int LocaleId

Support of Variables, Dynamic Text Background Setting, and Image Size Fit Mode in LINQ Reporting Engine

We have added a new parameter -fitSizeLim for image tag to change the size of the textbox according to the size of the image without increasing the size of the textbox. Please read the detail here:

We have added the support of variables in Aspose.Words 17.3.0. LINQ Reporting Engine enables you to use variables in template documents. Variables are useful when you need to calculate an expensive value just once and access it multiple times in a template. Please read the detail from here:

We have added support of setting text background color dynamically in Aspose.Words 17.3.0. Please read the detail here:

Aspose.Words for .NET Resources

The following resources will help you work with Aspose.Words for .NET: