Aspose.Words for .NET 19.2 Release Notes

Major Features

  • Supported inlining of syntax error messages into templates instead of exception throwing for LINQ Reporting Engine.
  • Improved font fetching and substitution mechanism with corresponding API changes.
  • Improved warnings for image processing issues when rendering to PDF.
  • Improved font fallback rendering for full-width character Unicode ranges.
  • Metafiles with “HeaderPlaceable” structure is now rendering regardless of structure checksum. (MS Word behavior).
  • The width of the DrawingML outline is now normalized if it is below the minimum value while rendering. (MS Word behavior).
  • Fixed a bug with incorrect calculation of DrawingML TextBox shape bounds.
  • Fixed a bug with the calculation of the shape boundaries if the document contains the attribute.ShapeLayoutLikeWW8 (the behavior of MS WORD 97 should be emulated).
  • Fixed a bug that caused an exception when rendering ultra-small text boxes in GDI+.
  • Fixed a bug with the distorted filling of the DrawingML shape outline when rendering grouped shapes.
  • Fixed a bug causing creation of blank images with zero size while rendering into HTML.
  • Improved ordering of number in RTL list labels.
  • Improved check box size calculation when active form fields are exported to PDF.
  • Fixed issue when document has “printer metrics” enabled and Windows has no printer driver installed.
  • Fixed hang when table cell is broken across pages when there is a floating shape anchor in it.
  • Fixed issue when text which has borders is wrapped around a shape and does not fit.

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
WORDSNET-14532Improve font substitution APIFeature
WORDSNET-16111Error handling in LINQ ReportingFeature
WORDSNET-15203Add more useful exception message when LINQ Reporting syntax is incorrectFeature
WORDSNET-17047ActiveX controls cold rendering // Radio buttons are jagged when saved as PDFEnhancement
WORDSNET-17725Border has zero width after importing from HTMLEnhancement
WORDSNET-11331Empty row appears conversion from DOCX to DOC/ PDFEnhancement
WORDSNET-17405The text is rendered to the next pageEnhancement
WORDSNET-14851Layout in PDF is not the same as in the WORD documentEnhancement
WORDSNET-15008Table content overlaps footer and does not go to next page in PDFEnhancement
WORDSNET-16413Content control is rendered on next in output PDFEnhancement
WORDSNET-17532Cell break is wrapped to the next pageEnhancement
WORDSNET-13756Throw meaningful exception for ReportingEngine.BuildReportEnhancement
WORDSNET-17950Extract common test code from Aspose.Words.TestsEnhancement
WORDSNET-17809ReportingEngine.buildReport throws java.lang.IllegalStateExceptionEnhancement
WORDSNET-17404Content are pushed down to the next page in output PDFEnhancement
WORDSNET-18018DOC/X to PDF - consumes lot of memory and takes too much timePerformance
WORDSNET-17911Loading big ODT file consumes too much timePerformance
WORDSNET-17623Issue with Aspose Memory UsagePerformance
WORDSNET-18017DOCX to HTML - Metafile checksum is invalid exception is thrownException
WORDSNET-17803MailMerge.ExecuteWithRegions throws System.InvalidOperationExceptionException
WORDSNET-17823MailMerge.ExecuteWithRegions throws System.IndexOutOfRangeExceptionException
WORDSNET-17849System.ArgumentOutOfRangeException is thrown when DOC is converted to PDFException
WORDSNET-18042InteropServices.ExternalException occurs when saving DOCX to an imageException
WORDSNET-18063Aspose.Words.FileCorruptedException is thrown while loading RTF fileException
WORDSNET-17999Wrong page numbers in PDFRegression
WORDSNET-18039System.NullReferenceException is thrown while saving DOCX to PDFRegression
WORDSNET-18055Cell’s text is not wrapped in output PDFRegression
WORDSNET-17655The table has been moved after renderingBug
WORDSNET-17841Extra paragraph added while loading HTML documentBug
WORDSNET-17591HTML to DOCX - output is not the sameBug
WORDSNET-17521Section Breaks not preserved during Open/Save an ODTBug
WORDSNET-17132Image not rendering in PDFBug
WORDSNET-9001Different table rendering for different compatibilityMode valuesBug
WORDSNET-17338Images Breaking When Converting to PDFBug
WORDSNET-17965DrawingML shape outline has incorrect width upon renderingBug
WORDSNET-17897A gradient line is not rendered in the right bottom part of the pageBug
WORDSNET-17880Gradient fill of DrawingML shape outline is rendered incorrectlyBug
WORDSNET-17647Text alignment of SVG text is ignored in output DOCX/PDFBug
WORDSNET-17455Merge HTML with word is failingBug
WORDSNET-17572The document creator appears at the top of the textBug
WORDSNET-17989Thick border around SmartArt appears during conversionsBug
WORDSNET-17830Converting MHTML to PDF produces no contentBug
WORDSNET-17902Repeating Content are lost after conversion from DOCX to PDFBug
WORDSNET-12376DOCX to PDF conversion issue with image positionBug
WORDSNET-17661Incorrect calculation of Page numbers in TOC by UpdateFields methodBug
WORDSNET-15996Incorrect shape position in PDF documentBug
WORDSNET-17855Checkbox size decreased during DOCX to PDF conversionBug
WORDSNET-17983DOCX to PDF conversion issue with shape’s positionBug
WORDSNET-18007A Chart’s Bar in SVG missing when inserted via Aspose.WordsBug
WORDSNET-11045Contents of table does not render correct in output DOC/ PDFBug
WORDSNET-15311Bookmarks referenced by fields issue in HTML to DOC conversionBug
WORDSNET-17994Mu character turns into an invalid Unicode character during converting doc to HTMLBug
WORDSNET-15077Text with full-width characters is indented incorrectly after import from HTMLBug
WORDSNET-17970Blank Image Generated during Word to HTML ConversionBug
WORDSNET-18041Assertion during layout updateBug
WORDSNET-18047Footnote color is changed after RTF to DOCX conversionBug
WORDSNET-17826HTML to DOCX conversion issue with extra line breakBug
WORDSNET-17629Vertical lines of SVG are rendered at incorrect position in DOCX/PDFBug
WORDSNET-17825Extra spacing issue with paragraph during HTML to Word conversionBug
WORDSNET-17416SVG is incorrectly imported into Aspose.Words DOMBug
WORDSNET-18026Cell’s text is not wrapped in output PDFBug
WORDSNET-17948Incorrect shape width metrics prevent table grid re-calculationBug
WORDSNET-17570Incorrect font size of the checkbox fieldBug
WORDSNET-17969Numbers in numeric list are reversed when document is converted to PDFBug
WORDSNET-18054Document.Save method throws exceptionBug
WORDSNET-17944MailMergeCleanupOptions does not cleanup mail merge fields correctlyBug
WORDSNET-18010AcceptAllRevisions() method inserts paragraph with white spacesBug
WORDSNET-17991DOC to PDF - investigate text misplacement and misalignmentBug
WORDSNET-16496Foreign language rendering as square boxesBug

Public API and Backward Incompatible Changes

This section lists public API changes that were introduced in Aspose.Words 19.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 existing behavior is especially important and is documented here.

Adjusted Warnings for Image Processing Issues When Saving to PDF

WORDSNET-17338 has now been resolved.

Previously there was one generic warning with text “Unsupported image format.”. Now there is a specific warning for OutOfMemoryException with the text “Not enough memory to load the image.” and a generic warning with the text “Image can not be processed. Possibly unsupported image format.”.

Changes in Font Substitution Process and Public API

WORDSNET-14532 has now been resolved:

Font fetching and substitution mechanism has been changed

Previously font fetching process was:

  1. Exact font name match
  2. Embedded font data from the document
  3. Font Substitutes specified for the font name
  4. AltName from FontInfo (if any) and the substitutes for AltName
  5. Font substitution if FontInfo is present and EnableFontSubstitution is set.
  6. DefaultFontName and the substitutes for DefaultFontName
  7. Any font from available font sources
  8. “Fanwood” font embedded into assembly.

Now font fetching process is:

  1. Exact font name match
  2. Embedded font data from the document
  3. AltName from FontInfo (if any)
  4. Font Substitution rules
    1. fontconfig substitution
    2. Table substitution for the font name and alt name
    3. Font info substitution
    4. Default font substitution
  5. Any font from available font sources
  6. “Fanwood” font embedded into assembly.

Here are some details about the particular changes:

  • Font Substitutes mechanism is replaced with table font substitution rule. Previously Font Substitutes mechanism was not a part of the font substitution process. Fonts selected via Font Substitutes was considered properly resolved. Now table substitution rule is a regular part of font substitution process. This implies that table substitution rule is not used now in several cases where Font Substitutes previously was used. In particular table substitution is not used now when performing font fallback and checking default font substitution rule. Customers could set up a suitable fallback table via FontSettings.FallbackSettings.
  • To better fit MS Word behavior, several well-known font aliases used unconditionally by MS Word are removed from default Windows font substitution table. Now Aspose.Words checks them before performing font substitution.
  • Added new feature to use the fontconfig utility to get the substitution fonts. fontconfig is designed to provide system-wide font configuration, customization and application access on Linux (and other Unix-like) systems.
  • Font substitution warnings messages are changed. Now they are in format “Font ‘’ has not been found. Using ‘’ font instead. Reason: .” with reasons:
    • “alternative name from document” for substitution by FontInfo.AltName
    • “fontconfig substitution” for substitution by font config rule
    • “table substitution” for substitution by table rule
    • “font info substitution” for substitution by font info rule
    • “default font substitution” for substitution by default font rule
    • “first available font” for substitution with first available font
public class FontSettings
{
    /// <summary>
    /// Settings related to font substitution mechanism.
    /// </summary>
    public FontSubstitutionSettings SubstitutionSettings
    { get; }
    [Obsolete("This property is obsolete. Please use SubstitutionSettings.DefaultFontSubstitution instead.")]
    public string DefaultFontName
    { get; set; }
    [Obsolete("This property is obsolete. Please use SubstitutionSettings.FontInfoSubstitution instead.")]
    public bool EnableFontSubstitution
    { get; set; }
    [Obsolete("This method is obsolete. Please use SubstitutionSettings.TableSubstitution instead.")]
    public string[] GetFontSubstitutes(string originalFontName);
    [Obsolete("This method is obsolete. Please use SubstitutionSettings.TableSubstitution instead.")]
    public void SetFontSubstitutes(string originalFontName, params string[] substituteFontNames);
    [Obsolete("This method is obsolete. Please use SubstitutionSettings.TableSubstitution instead.")]
    public void AddFontSubstitutes(string originalFontName, params string[] substituteFontNames);
}
/// <summary>
/// Specifies font substitution mechanism settings.
/// </summary>
/// <remarks>
/// <para>
/// Font substitution process consists of several rules which are checked one by one in specific order.
/// If the first rule can't resolve the font then second rule is checked and so on.</para>
/// <para>The order of the rules is following:
/// 1. Font config substitution rule (disabled by default)
/// 2. Table substitution rule (enabled by default)
/// 3. Font info substitution rule (enabled by default)
/// 4. Default font rule (enabled by default)
/// </para>
/// <para>
/// Note that font info substitution rule will always resolve the font if <see cref="FontInfo"/> is available
/// and will override the default font rule. If you want to use the default font rule then you should disable the
/// font info substitution rule. 
/// </para>
/// <para>
/// Note that font config substitution rule will resolve the font in most cases and thus overrides all other rules. 
/// </para>
/// </remarks>
public class FontSubstitutionSettings
{        
    /// <summary>
    /// Settings related to table substitution rule.
    /// </summary>
    public TableSubstitutionRule TableSubstitution
    { get; }
    /// <summary>
    /// Settings related to font info substitution rule.
    /// </summary>
    public FontInfoSubstitutionRule FontInfoSubstitution
    { get; }
    /// <summary>
    /// Settings related to default font substitution rule.
    /// </summary>
    public DefaultFontSubstitutionRule DefaultFontSubstitution
    { get; }
    /// <summary>
    /// Settings related to font config substitution rule.
    /// </summary>
    public FontConfigSubstitutionRule FontConfigSubstitution
    { get; }
}
/// <summary>
/// This is an abstract base class for the font substitution rule.
/// </summary>
public abstract class FontSubstitutionRule
{
    /// <summary>
    /// Specifies whether the rule is enabled or not.
    /// </summary>
    public bool Enabled
    { get; set; }
}
/// <summary>
/// Font config substitution rule.
/// </summary>
/// <remarks>
/// <para>
/// This rule uses fontconfig utility on Linux (and other Unix-like) platforms to get the substitution
/// if the original font is not available.
/// </para>
/// <para>
/// If fontconfig utility is not available then this rule will be ignored.
/// </para>
/// </remarks>
public class FontConfigSubstitutionRule : FontSubstitutionRule
{
    /// <summary>
    /// Check if fontconfig utility is available or not.
    /// </summary>
    public bool IsFontConfigAvailable();
    /// <summary>
    /// Resets the cache of fontconfig calling results.
    /// </summary>
    public void ResetCache();
}
/// <summary>
/// Table font substitution rule.
/// </summary>
/// <remarks>
/// This rule defines the list of substitute font names to be used if the original font is not available.
/// Substitutes will be checked for the font name and the <see cref="FontInfo.AltName"/> (if any).
/// </remarks>
public class TableSubstitutionRule : FontSubstitutionRule
{      
    /// <summary>
    /// Loads table substitution settings from XML file.
    /// </summary>
    /// <param name="fileName">Input file name.</param>
    public void Load(string fileName);
    /// <summary>
    /// Loads table substitution settings from XML stream.
    /// </summary>
    /// <param name="stream">Input stream.</param>
    public void Load(Stream stream);
    /// <summary>
    /// Loads predefined table substitution settings for Windows platform.
    /// </summary>
    public void LoadWindowsSettings();
    /// <summary>
    /// Loads predefined table substitution settings for Linux platform.
    /// </summary>
    public void LoadLinuxSettings();
    /// <summary>
    /// Saves the current table substitution settings to file.
    /// </summary>
    /// <param name="fileName">Output file name.</param>
    public void Save(string fileName);
    /// <summary>
    /// Saves the current table substitution settings to stream.
    /// </summary>
    /// <param name="outputStream">Output stream.</param>
    public void Save(Stream outputStream);
    /// <summary>
    /// Returns array containing substitute font names for the specified original font name.
    /// </summary>
    /// <param name="originalFontName">Original font name.</param>
    /// <returns>List of alternative font names.</returns>
    public IEnumerable<string> GetSubstitutes(string originalFontName);
    /// <summary>
    /// Override substitute font names for given original font name.
    /// </summary>
    /// <param name="originalFontName">Original font name.</param>
    /// <param name="substituteFontNames">List of alternative font names.</param>
    public void SetSubstitutes(string originalFontName, IEnumerable<string> substituteFontNames);
    /// <summary>
    /// Override substitute font names for given original font name.
    /// </summary>
    /// <param name="originalFontName">Original font name.</param>
    /// <param name="substituteFontNames">List of alternative font names.</param>
    public void SetSubstitutes(string originalFontName, params string[] substituteFontNames);
    /// <summary>
    /// Adds substitute font names for given original font name.
    /// </summary>
    /// <param name="originalFontName">Original font name.</param>
    /// <param name="substituteFontNames">List of alternative font names.</param>
    public void AddSubstitutes(string originalFontName, IEnumerable<string> substituteFontNames);
    /// <summary>
    /// Adds substitute font names for given original font name.
    /// </summary>
    /// <param name="originalFontName">Original font name.</param>
    /// <param name="substituteFontNames">List of alternative font names.</param>
    public void AddSubstitutes(string originalFontName, params string[] substituteFontNames);
}
/// <summary>
/// Font info substitution rule.
/// </summary>
/// <remarks>
/// According to this rule Aspose.Words evaluates all the related fields in <see cref="FontInfo"/> (Panose, Sig etc) for
/// the missing font and finds the closest match among the available font sources. If <see cref="FontInfo"/> is not
/// available for the missing font then nothing will be done.
/// </remarks>
public class FontInfoSubstitutionRule : FontSubstitutionRule
{ }
/// <summary>
/// Default font substitution rule.
/// </summary>
/// <remarks>
/// This rule defines single default font name to be used for substitution if the original font is not available.
/// </remarks>
public class DefaultFontSubstitutionRule : FontSubstitutionRule
{
    /// <summary>
    /// Gets or sets the default font name.
    /// </summary>
    /// <remarks>
    /// <para>The default value is 'Times New Roman'.</para>
    /// </remarks>
    public string DefaultFontName
    { get; set; }
}

Supported Inlining of Syntax Error Messages into Templates Instead of Exception Throwing for LINQ Reporting Engine

Issues: WORDSNET-16111, WORDSNET-15203, WORDSNET-13756

The “Inlining Syntax Error Messages into Templates” section of the engine’s documentation was added to describe the change.

Removed Deprecated Public Property TxtSaveOptions.ExportHeadersFooters

Issue: WORDSNET-17560

Removed deprecated public property TxtSaveOptions.ExportHeadersFooters:

// Specifies whether to output headers and footers when exporting in plain text format.

// Default value is <b>true</b>.
public bool ExportHeadersFooters

Please use TxtSaveOptions.ExportHeadersFootersMode property instead.