Aspose.Words for .NET 19.1 Release Notes

Major Features

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

  • Implemented the directed line caps rendering for Bezier curves in metafiles.
  • Implemented processing of the stroke properties while rendering custom line caps in metafiles.
  • Implemented support of Unicode font names while rendering to PDF.
  • Implemented Tiff binarization threshold control via ImageSaveOptions.ThresholdForFloydSteinbergDithering property.
  • Fixed a bug that prevents rendering of horizontal lines with gradient fill in DrawingML.
  • Fixed a bug when gradient fill is not rotated with DrawingML shapes by default.
  • Fixed a bug that caused an incorrect rendering of DrawingML shapes inside groups when 3D rotation was applied.
  • Fixed a bug with the calculation of the point coordinates if the date axis is replaced by the string axis.
  • Fixed a bug with vertical alignment of Ruby objects while rendering.
  • Fixed a bug that caused the creation of extra link tags in output PDF when rendering documents with footnotes.
  • Supported dynamic table cell merging for LINQ Reporting Engine.
  • Supported textual comments within LINQ Reporting Engine template syntax tags.
  • Improved computation of wrap bounds of floating objects which affects position of text nearby.
  • Improved positioning of line when it cannot fit next to floating object and has to be pushed below.
  • Implemented navigation from footnote reference to footnote for PDF output.
  • Fixed exception which may happen when spans are merged in paragraphs with different directionality.
  • Fixed exception which may happen when span has null shading inside text box.

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
WORDSNET-16891DOCX to PDF conversion issue with text wrapping around the tableBug
WORDSNET-17644The scaling of the second vertical axis and the placement of the grey line are changed after converting to PDFBug
WORDSNET-5656Images are rendering incorrectly/misplaced in Fixed FormatsBug
WORDSNET-17723Field code of hyperlink is changed after conversion from RTF to DOCXBug
WORDSNET-17824Extra link tag is added for footnotes inside tableBug
WORDSNET-17434Gradient shape is lost after conversion from DOCX to PDFBug
WORDSNET-17442Superscipt on Japanese characters vertical misalignmentBug
WORDSNET-17802DOCX to PDF conversion issue with charts’ renderingBug
WORDSNET-16475Extra left margin is added after conversion from HTML to MHTBug
WORDSNET-17632DOCX to HTML conversion issue with table borderBug
WORDSNET-17638Word to HTML Paragraph Formatting IssueBug
WORDSNET-17414MHTML to PDF conversion issue with text positionBug
WORDSNET-17878Copied styles don’t match the source stylesBug
WORDSNET-17896Shape’s contents are lost in output PDFBug
WORDSNET-17739BuiltInDocumentProperties.Bytes always does not return a valid number of bytesBug
WORDSNET-17840Border color not modified when changing Accent colorBug
WORDSNET-17884Arrow shapes do not render correctly in output PDFBug
WORDSNET-17717Incorrect list markers in a RTF documentBug
WORDSNET-17900Font Name Not Properly Embedded in Converted PDFBug
WORDSNET-17438Document with ‘PlaceHolder Text’ style, get corrupted after UpdateFields() using Aspose.WordsBug
WORDSNET-17444Text wrapping problems when saving to PDFBug
WORDSNET-13626Extra empty page is created after conversion from Docx to PdfBug
WORDSNET-16468Position of chart is changed in output PDFBug
WORDSNET-15961Style.AddCopy changes the style nameBug
WORDSNET-17922Missing Text when converting RTF to PDFBug
WORDSNET-17837DOCX to PDF conversion issue with GroupShape renderingBug
WORDSNET-17953Gradient fill has incorrect direction while rendering rotated DML shapesBug
WORDSNET-16517SymbolSetRemapUndefined error appears when printing PCL generated by Aspose.WordsBug
WORDSNET-17850How to merge table cells using the Linq engineBug
WORDSNET-17863DOCX to PDF conversion issue with list label renderingBug
WORDSNET-17615Different time format in doc and pdfBug
WORDSNET-17797DOCX with picture yields faulty PDF with black areasBug
WORDSNET-17538ImportFormatMode issues with KeepSourceFormatting and KeepDifferentStyles when importing nodesBug
WORDSNET-17819Expose the threshold control for Tiff binarization // Saving from Word to Tif - binarization settingsEnhancement
WORDSNET-17068Arrow Heads truncate when converting DOCX to PDFEnhancement
WORDSNET-17765Make footnote endnote numbers hyperlinks leading to corresponding note entry in main storyEnhancement
WORDSNET-4876Footnotes and endnotes references need to be rendered as active linksEnhancement
WORDSNET-17598System.NullReferenceException occurs when rendering DOC to PDFException
WORDSNET-16577SEH exceptions raises while instancing Document classException
WORDSNET-17672Document.UpdatePageLayout throws System.NullReferenceExceptionException
WORDSNET-17959System.OverflowException is thrown while reading the ODT fileException
WORDSNET-17926An exception raises while converting ODT to DOCXException
WORDSNET-17814MailMerge.ExecuteWithRegions throws System.NullReferenceExceptionException
WORDSNET-17903Document.Compare throws System.ArgumentOutOfRangeExceptionException
WORDSNET-15798Add feature to merge table’s cell vertically depending upon data structureFeature
WORDSNET-17786Add name to foreach syntax of Linq ReportingFeature
WORDSNET-17784UnsupportedOperationException upon loading DocRegression
WORDSNET-17956System.InvalidCastException occurs upon converting DOC to DOCXRegression

Public API and Backward Incompatible Changes

This section lists public API changes that were introduced in Aspose.Words 19.1. 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.

Different Time Format in DOC and PDF (Added IFieldUpdateCultureSource)

WORDSNET-17615 has now been resolved.

A customer complained about incorrect date/time formatting. We have figured out that there is a difference between MS Word formatting and .NET/Windows formatting and also between different .NET Framework versions.

When thinking on how to fix this issue, we opted for providing the customer with a flexible way of specifying a culture defining date/time formatting on per field basis. To do so, we have introduced the IFieldUpdateCultureSource interface:

    /// <summary>
    /// When implemented, provides a <see cref="CultureInfo"/> object that should be used during the update of a particular field.
    /// </summary>
    public interface IFieldUpdateCultureProvider
    {
        /// <summary>
        /// Returns a <see cref="CultureInfo"/> object to be used during the field's update.
        /// </summary>
        /// <param name="culture">The name of the culture requested for the field being updated.</param>
        /// <param name="field">The field being updated.</param>
        /// <returns>The culture object that should be used for the field's update.</returns>
        CultureInfo GetCulture(string culture, Field field);
    }

and the corresponding FieldOptions property:

/// <summary>
/// Gets or sets a provider that returns a culture object specific for each particular field.
/// </summary>
/// <remarks>
/// <para>The provider is requested when the value of <see cref="FieldUpdateCultureSource"/> is <b>FieldUpdateCultureSource.FieldCode</b>.</para>
/// <para>If the provider is present, then the culture object it returns is used for the field update. Otherwise, a system culture is used.</para>
/// </remarks>
public IFieldUpdateCultureProvider FieldUpdateCultureProvider

Usage:

document.FieldOptions.FieldUpdateCultureSource = FieldUpdateCultureSource.FieldCode;
document.FieldOptions.FieldUpdateCultureProvider = new FieldUpdateCultureProvider();
private class FieldUpdateCultureProvider : IFieldUpdateCultureProvider
{
	public CultureInfo GetCulture(string name, Field field)
	{
		switch (name)
		{
			case "ru-RU":
				CultureInfo culture = new CultureInfo(name, false);
				DateTimeFormatInfo format = culture.DateTimeFormat;
				format.MonthNames = new []{"месяц 1", "месяц 2", "месяц 3", "месяц 4", "месяц 5", "месяц 6", "месяц 7", "месяц 8", "месяц 9", "месяц 10", "месяц 11", "месяц 12", ""};
				format.MonthGenitiveNames = format.MonthNames;
				format.AbbreviatedMonthNames = new []{"мес 1", "мес 2", "мес 3", "мес 4", "мес 5", "мес 6", "мес 7", "мес 8", "мес 9", "мес 10", "мес 11", "мес 12", ""};
				format.AbbreviatedMonthGenitiveNames = format.AbbreviatedMonthNames;
				format.DayNames = new []{"день недели 7", "день недели 1", "день недели 2", "день недели 3", "день недели 4", "день недели 5", "день недели 6"};
				format.AbbreviatedDayNames = new []{"день 7", "день 1", "день 2", "день 3", "день 4", "день 5", "день 6"};
				format.ShortestDayNames = new []{"д7", "д1", "д2", "д3", "д4", "д5", "д6"};
				format.AMDesignator = "До полудня";
				format.PMDesignator = "После полудня";
				const string pattern = "yyyy MM (MMMM) dd (dddd) hh:mm:ss tt";
				format.LongDatePattern = pattern;
				format.LongTimePattern = pattern;
				format.ShortDatePattern = pattern;
				format.ShortTimePattern = pattern;
				return culture;
			case "en-US":
				return new CultureInfo(name, false);
			default:
				return null;
		}
	}
}

Customers are now able to specify any culture and any date/time formatting for a particular field based on the specified name.

Expose the threshold control for Tiff binarization

WORDSNET-17819 has now been resolved:

New public property was added to ImageSaveOptions  class:

/// <summary>
/// Gets or sets the threshold that determines the value
/// of the binarization error in the Floyd-Steinberg method.
/// when <see cref="ImageBinarizationMethod"/> is ImageBinarizationMethod.FloydSteinbergDithering.
/// </summary>
/// <remarks>
/// <para>The default value is 128.</para>
/// </remarks>
public byte ThresholdForFloydSteinbergDithering
{
    get { return mThresholdForFloydSteinbergDithering; }
    set { mThresholdForFloydSteinbergDithering = value; }
}

The higher the value, the darker the image.

UC

Document doc = new Document ("inputFileName");
ImageSaveOptions options = new ImageSaveOptions(Aspose.Words.SaveFormat.Tiff);
options.TiffCompression = TiffCompression.Ccitt3;
options.ImageColorMode = ImageColorMode.Grayscale;
options.TiffBinarizationMethod = ImageBinarizationMethod.FloydSteinbergDithering;
options.ThresholdForFloydSteinbergDithering = 254;
doc.Save("outputFileNameC.tiff", options);