Browse our Products

Aspose.Words for .NET 18.10 Release Notes

Major Features

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

  • Implemented new API to set up font fallback mechanism through XML configuration.
  • Provide option to Use a style to format text typed into the SDT control.
  • Add feature to insert Horizontal Rule into document.
  • PNG images with a corrupted file structure are not skipped now from the rendering if it is possible to read information about their size.
  • Improved rendering of abscissa labels of a DrawingML Chart if the axis contains a large number of dummy values.
  • Improved scaling of the vertical axis of DrawingML Charts if a small range is used.
  • Fixed an error causing an exception while rendering pattern-filled DrawingML shapes when pattern is not specified.
  • Fixed a rendering glitch caused by negative arcsize of rounded rectangle VML shapes.
  • Fixed a bug with rendering of the gridlines in a DrawingML Chart if the interval between tick marks is specified.
  • Fixed a bug with rendering of the second axis title in a DrawingML Chart if manual layout is set.
  • Fixed issue with paragraph above spacing for page break lines in compatibility mode.
  • Fixed rendering of hidden paragraph in TOC fields.
  • Fixed line wrapping in compatibility mode when line break follows inline shape wider that column.
  • Improved rendering of underlines, it is now based on fields of the POST table in OTF fonts.
  • Improved alignment of page relative shapes for documents created in Word 2013 and later.
  • LINQ Reporting Engine supports removal of paragraphs becoming empty after template syntax tags are removed or replaced with empty values.

 Full List of Issues Covering all Changes in this Release

KeySummaryCategory
WORDSNET-17033PDF output is corrupted after some pageBug
WORDSNET-17257Missing Text when converting RTFBug
WORDSNET-16997Space characters in an OfficeMath equation disappear after conversion to MathMLBug
WORDSNET-17411Document is not rendered properlyBug
WORDSNET-17128Word to PDF - Bookmark creation issue with style separatorBug
WORDSNET-17057DOCX to PDF conversion issue with English and Chinese textBug
WORDSNET-16837Document.PageCount returns wrong valueBug
WORDSNET-17397Add feature to insert Horizontal Rule into documentBug
WORDSNET-17201Aspose.Words produces invalid EPUB documents if HtmlSaveOptions.Encoding is not UTF-8 or UTF-16Bug
WORDSNET-14593A picture at bottom right corner of first page moves inches towards left in PDFBug
WORDSNET-17403Incorrect rendering of X-axis labels after converting to PDFBug
WORDSNET-17130Converting Word to Pdf the text layout in Pdf is not correctBug
WORDSNET-17333Extracted Ole Object has wrong Signature and Binary values differ every time Aspose.Words code executesBug
WORDSNET-17388TextBox Picture are not preserved in rendered PDFBug
WORDSNET-17413Document.UpdateFields does not update the TOC field under Swedish cultureBug
WORDSNET-5801Large tables flow off the side of the page when renderingBug
WORDSNET-8175Incorrect Table/Cell widths are exported to PDFBug
WORDSNET-7697Header/Footer cut off at the right side of page after conversion from Doc to Fixed file formatBug
WORDSNET-10207Tables appear behind the Shapes in rendered PDFBug
WORDSNET-10420Docx to Pdf conversion issue with text indentationBug
WORDSNET-17195Table cell borders in an HtmlFixed document become invisible in ChromeBug
WORDSNET-17374List Export to HTML Default Behavior VariesBug
WORDSNET-11126Docx to Pdf/Doc conversion issue with table’s positionBug
WORDSNET-17330Unable to completely remove cell spacing in RTF tablesBug
WORDSNET-17395Table direction changed from ‘Right-to-left’ to ‘Left-to-right’Bug
WORDSNET-14256OutlineOptions.HeadingsOutlineLevels does not export heading levels when Html is exported to PdfBug
WORDSNET-16978Fallback content of an <object> element is imported from HTML even if element’s data are availableBug
WORDSNET-17319HTML-to-Words converter generates corrupted DOCXBug
WORDSNET-17402Watermark is not rendered in output PDFBug
WORDSNET-17314A DOCX document produced by Aspose.Words cannot be opened in MS WordBug
WORDSNET-17370Text in a table gets overlapped during PDF conversionBug
WORDSNET-17463Hyperlink is lost after conversion from DOC to DOCXBug
WORDSNET-17131Font is changing when convert DOC to PDFBug
WORDSNET-17331Underlined text is Illegible after Word to PDFBug
WORDSNET-12372Text underline problem in PDFBug
WORDSNET-16783Style.BaseStyleName not working properlyBug
WORDSNET-17069System.NullReferenceException is thrown while inserting document loaded by “doc” tag in Foreach blockBug
WORDSNET-17261ReportingEngine: Blank line appearing after -html inputBug
WORDSNET-17525InsertDocument inserts a white space at the start of content when inserting at the very beginning of a paragraphBug
WORDSNET-17479Links to internal members in public API DocumentationEnhancement
WORDSNET-17394Strange white thick line added to the tableEnhancement
WORDSNET-17399Some metadata properties are missing after document savingEnhancement
WORDSNET-17482Try to render PNG images with corrupted structure // DOCX to PDF - image is lostEnhancement
WORDSNET-17430System.InvalidOperationException occurs during rendering DOC to PDFException
WORDSNET-17185System.ArgumentOutOfRangeException is thrown while saving DOCX to HTMLException
WORDSNET-17143Transparent graphics not getting converted correctlyException
WORDSNET-17137Exception occurs when saving HTML to HTMLException
WORDSNET-17189Document.Save throws System.ArgumentNullExceptionException
WORDSNET-17437System.InvalidCastException occurs upon loading a DOCException
WORDSNET-8223UpdateFields throws OutOfMemoryExceptionException
WORDSNET-17236Aspose.Words.FileCorruptedException occurs when loading a DOCMException
WORDSNET-17328DocumentBuilder.InsertField throws System.InvalidOperationExceptionException
WORDSNET-17114Aspose.Words.FileCorruptedException is thrown while loading DOTException
WORDSNET-15965Korean characters rendering issue when saving word doc as PDFFeature
WORDSNET-16938The language detection of every Run objectFeature
WORDSNET-16068Rupee symbol does not render in PDF when old version of Arial font is usedFeature
WORDSNET-14601Provide option to Use a style to format text typed into the SDT controlFeature
WORDSNET-17093Add ability to remove paragraphs becoming empty after template extressions are evaluated to empty valuesFeature
WORDSNET-16491Add feature to remove list item when data source is empty or nullFeature
WORDSNET-16953Remove empty paragraph when IF condition returns false in LINQ ReportingFeature
WORDSNET-17235Add feature to remove last list number when HTML is inserted by LINQ ReportingFeature
WORDSNET-2783WordArt rendering support (advanced features)Feature
WORDSNET-10108Saving to PDF is very slowPerformance
WORDSNET-17219Document is corrupted after conversion from HTML to DOCXRegression

Public API and Backward Incompatible Changes

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

LINQ Reporting Engine Supports Removal of Paragraphs becoming Empty after Template Syntax Tags are Removed or Replaced with Empty Values

Issues WORDSNET-17093, WORDSNET-17235, WORDSNET-17261, WORDSNET-16491 and WORDSNET-16953 have now been fixed.

The following new member added to the ReportBuildOptions enum:

/// <summary>
/// Specifies that the engine should remove paragraphs becoming empty after template syntax tags are
/// removed or replaced with empty values.
/// </summary>
RemoveEmptyParagraphs

When the option is applied to ReportingEngine.Options, the engine additionally removes paragraphs becoming empty after template syntax tags are removed or replaced with empty values as shown in the following examples.

Example 1

Template document

Prefix
<<[""]>>
Suffix

Result document without ReportBuildOptions.RemoveEmptyParagraphs applied

Prefix
Suffix

Result document with ReportBuildOptions.RemoveEmptyParagraphs applied

Prefix
Suffix

Example 2

Template document

Prefix
<<if [false]>>
Text to be removed
<</if>>
Suffix

Result document without ReportBuildOptions.RemoveEmptyParagraphs applied

Prefix
Suffix

Result document with ReportBuildOptions.RemoveEmptyParagraphs applied

Prefix
Suffix

Example 3

Template document

Prefix
<<foreach [in persons]>>
<<[Name]>>
<</foreach>>
Suffix

Result document without ReportBuildOptions.RemoveEmptyParagraphs applied

Prefix
John Doe
Jane Doe
John Smith
Suffix

Result document with ReportBuildOptions.RemoveEmptyParagraphs applied

Prefix
John Doe
Jane Doe
John Smith
Suffix

NodeRendererBase.BoundsInPoints Property Made Public

NodeRendererBase.BoundsInPoints property made public:

/// <summary>
/// Gets the actual bounds of the shape in points.
/// </summary>
/// <remarks>
/// This property returns the actual (as rendered on the page) bounding box of the shape.
/// The bounds takes into account shape rotation (if any).
/// </remarks>
public RectangleF BoundsInPoints

This property is added for convenience in addition to SizeInPoints property and GetBoundsInPixels() method.

Added API for Font Fallback Settings

We have added new API to set up font fallback mechanism. The font fallback mechanism is described in documentation.

public class FontSettings
{
    /// <summary>
    /// Settings related to font fallback mechanism.
    /// </summary>
    public FontFallbackSettings FallbackSettings
    {
        get { return mFallbackSettings; }
    }
}
/// <summary>
/// Specifies font fallback mechanism settings.
/// </summary>
/// <remarks>
/// By default fallback settings are initialized with predefined settings which mimics the Microsoft Word fallback.
/// </remarks>
public class FontFallbackSettings
{
	/// <summary>
	/// Loads font fallback settings from XML file.
	/// </summary>
	/// <param name="fileName">Input file name.</param>
	public void Load(string fileName);
	/// <summary>
	/// Loads fallback settings from XML stream.
	/// </summary>
	/// <param name="stream">Input stream.</param>
	public void Load(Stream stream);
	/// <summary>
	/// Loads predefined fallback settings which mimics the Microsoft Word fallback and uses Microsoft office fonts.
	/// </summary>
	public void LoadMsOfficeFallbackSettings();
	/// <summary>
	/// Saves the current fallback settings to stream.
	/// </summary>
	/// <param name="outputStream">Output stream.</param>
	public void Save(Stream outputStream);
	/// <summary>
	/// Saves the current fallback settings to file.
	/// </summary>
	/// <param name="fileName">Output file name.</param>
	public void Save(string fileName);
	/// <summary>
	/// Automatically builds the fallback settings by scanning available fonts.
	/// </summary>
	/// <remarks>
	/// This method may produce non-optimal fallback settings. Fonts are checked by <a href="https://docs.microsoft.com/en-us/typography/opentype/spec/os2#ur">
	/// Unicode Character Range</a> fields and not by the actual glyphs presence. Also Unicode ranges are checked individually
	/// and several ranges related to single language/script may use different fallback fonts.
	/// </remarks>
	public void BuildAutomatic();
}

Here is sample XML file which describes the format.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<FontFallbackSettings xmlns="Aspose.Words">
    <FallbackTable>
		<!-- Fallback table consists of the rules. Each rule defines the fallback fonts which Aspose.Words should use for specified Unicode ranges and base fonts. Rules are checked one by one and the first applicable fallback font is used. If none of the rules are applicable then ".notdef" glyph (missing glyph) from the base font will be used. -->
		<!-- This rule defines that "Vijaya" fallback font should be used for "U+0B80..U+0BFF Tamil" Unicode block. -->
        <Rule Ranges="0B80-0BFF" FallbackFonts="Vijaya"/>
		<!-- This rule defines that "Segoe UI Emoji" and "Segoe UI Symbol" fallback fonts should be used for "U+1F300..U+1F5FF Miscellaneous Symbols and Pictographs", "U+1F600..U+1F64F Emoticons" Unicode blocks. If "Segoe UI Emoji" font does not contains the glyph for the requested Unicode code point then "Segoe UI Symbol" will be checked. -->
		<Rule Ranges="1F300-1F64F" FallbackFonts="Segoe UI Emoji, Segoe UI Symbol"/>
		<!-- This rule defines that "Arial" fallback font should be used for "U+2000..U+206F General Punctuation", "U+2070..U+209F Superscripts and Subscripts" Unicode blocks and specific "U+20B9 INDIAN RUPEE SIGN" code point. -->
		<Rule Ranges="2000-206F, 2070-209F, 20B9" FallbackFonts="Arial">
		<!-- These rules defines that for "U+3040..U+309F Hiragana" Unicode block "MS Gothic" fallback font should be used if base font is "Times New Roman" and "MS Mincho" fallback font for all other base fonts. -->
        <Rule Ranges="3040-309F" FallbackFonts="MS Gothic" BaseFonts="Times New Roman"/>
		<Rule Ranges="3040-309F" FallbackFonts="MS Mincho"/>
		<!-- This rule defines that "Arial Unicode MS" fallback font should be used if applicable fallback font was not found by previous rules. -->
		<Rule FallbackFonts="Arial Unicode MS"/>
    </FallbackTable>
</FontFallbackSettings>

Option to Use a Style to Format Text Typed into the SDT Control Provided

WORDSNET-14601 has now been resolved.

A new property has been added to the StructuredDocumentTag class:

/// <summary>
/// Gets or sets the style applied to this SDT.
/// </summary>
public Style Style

It can also be accessed via the string property “StyleName” like that what Font, ParagraphFormat and Table have.

/// <summary>
/// Gets or sets the name of the table style applied to this SDT.
/// </summary>
public string StyleName

Note.

Only Linked and Character styles can be applied to an SDT. An InvalidOperationException (“Cannot apply this style to the SDT”) is thrown when a style that exists but is not Linked or Character style is being applied.

UC1. Setting a style to an SDT.
StructuredDocumentTag sdt = ...
Style style = doc.Styles[styleName];
sdt.Style = style;
UC 1.1. Setting a style to an SDT via StyleName.
StructuredDocumentTag sdt = ...
sdt.StyleName = "Quote";
UC 1.2 Removing defined style.

To remove the applied style the default Style should be applied.

StructuredDocumentTag sdt = ...
sdt.StyleName = "Default Paragraph Font";
UC 2. Getting applied to sdt control style.

Note. When a linked style is applied to an sdt a paragraph style is returned.

StructuredDocumentTag sdt = ...
Style style = sdt.Style; //paragraph style name will be returned if it's linked with a character style
UC 2.1 Getting applied to sdt control style via accessing StyleName.
StructuredDocumentTag sdt = ...
string styleName = sdt.StyleName; //paragraph style name will be returned if it's linked with a character style
UC 2.2 Accessing style that is not defined.
StructuredDocumentTag sdt = ...
//... style was not defined before
Style style = sdt.Style;
//style should be "Default Paragraph Font"

Feature to Copy All Styles from Template

WORDSNET-16783 has now been resolved.

Following methods were added:

public void Document.CopyStylesFromTemplate(string template)
public void Document.CopyStylesFromTemplate(Document template)

Methods copies all styles from template trying to preserve style hierarchy for base and linked styles.

UC

string templateFileName = "template file name";
Document target = new Document("target document file name");
target.CopyStylesFromTemplate(templateFileName);

DocumentBuilder.InsertField Throws System.InvalidOperationException

WORDSNET-17328 has now been resolved.

A customer requested the ability to insert untyped/empty fields ({}) just like MS Word allows doing so. By the moment AW threw System.InvalidOperationException when attempting to insert FieldType.FieldNone (which was the way the customer tried to insert an untyped field):

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.InsertField(FieldType.FieldNone, false);

Since mimicking MS Word is one of our primary goals, we have supported inserting untyped fields. This is resulted in making the FieldUnknown class public because DocumentBuilder returns its instance. It existed prior to that, but used to be internal.

/// <summary>
/// Implements an unknown or unrecognized field.
/// </summary>
public class FieldUnknown : Field

Use case:

DocumentBuilder builder = new DocumentBuilder();
FieldUnknown field = (FieldUnknown)builder.InsertField(FieldType.FieldNone, false);

Added Public Property AllowCellSpacing

WORDSNET-17330 has now been resolved.

New public property AllowCellSpacing was added into the Table class:

/// <summary>
/// Gets or sets the "Allow spacing between cells" option.
/// </summary>
public bool AllowCellSpacing

This property allows to control spacing between cells. Setting this property to false will completelly remove spacing between cells

UC:

// Remove spacing between cells
table.AllowCellSpacing = false;

Added Feature to Insert Horizontal Rule into Document

WORDSNET-17397 has now been resolved.

The builder.InsertHorizontalRule() method was added to the DocumentBuilder class:

/// <summary>
/// Inserts a horizontal rule shape into the document.
/// </summary>
public void InsertHorizontalRule()

This adds a horizontal rule to a document without using builder.InsertHtml("<hr>") method.

Use case:

builder.InsertHorizontalRule();