Aspose.Words for .NET 20.3 Release Notes

Major Features

  • No separate DLLs for Xamarin anymore.
  • FindReplaceOptions class is extended with new properties.
  • Implemented the correct rendering of the “Letterlike” symbols.
  • Supported dynamic stretching of an image within textbox bounds preserving the ratio of the image for the LINQ Reporting Engine.

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
WORDSNET-18362LINQ Reporting Engine - Provide option to fit the image within textbox bounds while maintaining ratioNew Feature
WORDSNET-19568Provide ability to set different attributes of Shape inside IFieldMergingCallback.ImageFieldMergingNew Feature
WORDSNET-19912FindReplaceOptions new propertiesNew Feature
WORDSNET-20012Implement color change for side facesNew Feature
WORDSNET-3297Consider adding an ability to get column of table by bookmarkNew Feature
WORDSNET-19935Implement correct contour rendering for volume shapesNew Feature
WORDSNET-19469Axis, data and legend labels in chart are missing/wrong/in different colors in PDF converted from DOCXEnhancement
WORDSNET-19815Do not convert ODT chart to shapeEnhancement
WORDSNET-19998Implement correct contour rendering for non convex shapesEnhancement
WORDSNET-15635Arrow shape shifts towards left in rendered documentBug
WORDSNET-19233Extra blank page when saving MHTML into JPG/PNG/PDFBug
WORDSNET-18325DOCX to PDF conversion issue with Arabic text renderingBug
WORDSNET-18389Some Arabic characters look different in PDF renditionBug
WORDSNET-17392Document.PageCount returns incorrect valueBug
WORDSNET-18583DOCX to PDF conversion issue with hanging indent of textBug
WORDSNET-19670Analyze if .NET Standard can cover Xamarin platformsBug
WORDSNET-19559Indenting of bullet point in converted TIFF fileBug
WORDSNET-19960System.StackOverflowException is thrown while loading DOCBug
WORDSNET-14306DOCX to PDF conversion issue with image renderingBug
WORDSNET-14729Word to PDF conversion has issues with imagesBug
WORDSNET-20039System.InvalidCastException is thrown while saving DOCX to PDFBug
WORDSNET-17340Issue in PDF conversion with images and text fieldBug
WORDSNET-19717Formatting of double quote is lost after calling Document.UpdateFieldsBug
WORDSNET-18540DOCX to PDF conversion issue with text positionBug
WORDSNET-19589PDF rendition is not accurate and few pages are missedBug
WORDSNET-19970Generated html cuts off picture and overlaps footer contentBug
WORDSNET-19971Word save to PDF numbering problem in ListBug
WORDSNET-19967System.InvalidCastException is thrown while saving document to PDF after comparing DOCXsBug
WORDSNET-19957Floating point numbers aren’t saved in CustomDocumentProperties for RTF filesBug
WORDSNET-19726Text Columns are changed after using DocumentBuilder.InsertDocumentBug
WORDSNET-19818Footnotes issue while converting to PDFBug
WORDSNET-19842Field “SaveDate” is initially not setBug
WORDSNET-19905Setting any Value for Font.NoProofing Turns Off Proofing in RTF DocumentBug
WORDSNET-19987Tables are missing while XML to DOCX document conversionBug
WORDSNET-19204NumberFormat.FormatCode does not work for Currency symbolsBug
WORDSNET-19988Garbled characters when loading RTF and saving as DOCXBug
WORDSNET-19989Incorrect rendering of the legend item of the series with borderBug
WORDSNET-19991Page margins are changed after inserting document into template using InsertDocumentBug
WORDSNET-19997ODT document layout is changedBug
WORDSNET-19909DOCX>HTML>DOCX conversion issue with indentation and spacingBug
WORDSNET-19276Extra text appears besides table in PDFBug
WORDSNET-19999Remove obsolete property DigitalSignature.Certificate and CertificateHolder.CreateBug
WORDSNET-18883Rendering order for floating TextFrameBug
WORDSNET-20018AutoOpen Macro does not work after calling VBAProject.Clone using C#Bug
WORDSNET-18872Document language is changed from Hebrew to Arabic after DOCX>HTML>DOCXBug
WORDSNET-19776PRINTDATE does not render correctly in output PDFBug
WORDSNET-18884Word to PDF or SVG conversion - repeated table headers not being displayedBug
WORDSNET-19918NullReference exception if call UpdateFields before SaveBug
WORDSNET-19919Exception while converting HTML to WordsBug
WORDSNET-19786Hyperlink is changed after conversion from DOCX to PDFBug
WORDSNET-19927Inserting Table into document: font size is missing in inserted tableBug
WORDSNET-19930Vertical character has been changed to horizontal character in PDFBug
WORDSNET-19928Japanese text - incorrect line wrapping in PDFBug
WORDSNET-19937Aspose.Words Detects PDF Files as TEXTBug
WORDSNET-19417While converting to PDF the code throws NullPointerException on saving documentBug
WORDSNET-19836Fails insert list during saving to existing .md documentBug
WORDSNET-19954Page background and text color is changed after RTF to TIFF conversionBug
WORDSNET-19147NodeRendererBase.Save does not render OfficeMath correctlyBug
WORDSNET-19150OfficeMath rendering is incorrectBug
WORDSNET-19148Problem with OfficeMath renderingBug
WORDSNET-19451Image is lost after conversion from DOCX to PDF at AzureBug
WORDSNET-16662GroupShape truncates in rendered PDFBug
WORDSNET-13800Diagram gets messed up during open/save to PDFBug
WORDSNET-14754Japanese ‘onbiki’ symbol rendered incorrectly after conversion from .RTFBug
WORDSNET-16999A Drawing renders partially in generated PDFBug
WORDSNET-17339Issue in PDF conversion with images and text fieldBug
WORDSNET-8588Symbols are rotated when DOCX is converted to PDFBug
WORDSNET-8665Table position is changed after conversion from DOCX to PDFBug
WORDSNET-19690Assertion in debug code when saving to PDFBug
WORDSNET-19934Incorrect page count value for .ODT formatBug
WORDSNET-15353Image position is changed in output PDFBug
WORDSNET-19986Application hangs when opening HTM fileBug

Public API and Backward Incompatible Changes

This section lists public API changes that were introduced in Aspose.Words 20.3. 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 a new public property SaveOptions.UpdateLastPrintedProperty

Related issue: WORDSNET-19776

Added a new public property SaveOptions.UpdateLastPrintedProperty:

.NET

/// <summary>
/// Gets or sets a value determining whether the BuiltInDocumentProperties.LastPrinted property is updated before saving.
/// </summary>
public bool UpdateLastPrintedProperty

It’s true by default for FixedPageSaveOptions.

Use Case:

.NET

Document doc = new Document(docPath);
SaveOptions saveOptions = new PdfSaveOptions();
saveOptions.UpdateLastPrintedProperty = false;
doc.Save(pdfPath, saveOptions);

Added the ImageFieldMergingArgs.Shape property

Reference: WORDSNET-19568

A customer requested controlling various image properties when merging an image merge field, in particular, WrapType. Currently, it is only possible to set image width or height using the ImageFieldMergingArgs.ImageWidth and ImageFieldMergingArgs.ImageHeight properties, respectively.

We’ve opted for a more generic approach and decided to provide full control over the image (or any other shape) being inserted. We’ve introduced the ImageFieldMergingArgs.Shape property:

.NET

/// <summary>
/// Specifies the shape that the mail merge engine must insert into the document.
/// </summary>
/// <remarks>
/// <p>When this property is specified, the mail merge engine ignores all other properties like <see cref="ImageFileName"/> or <see cref="ImageStream"/>
/// and simply inserts the shape into the document.</p>
/// <p>Use this property to fully control the process of merging an image merge field.
/// For example, you can specify <see cref="ShapeBase.WrapType"/> or any other shape property to fine tune the resulting node. However, please note that
/// you are responsible for providing the content of the shape.</p>
/// </remarks>
public Shape Shape { get; set; }

As the summary states, this property overrides others like ImageFileName or ImageStream, i.e. the user just specifies a shape they want to insert with all necessary properties set:

.NET

private class TestShapeSetFieldMergingCallback : IFieldMergingCallback
{
    void IFieldMergingCallback.FieldMerging(FieldMergingArgs args)
    {
        //  Implementation is not required.
    }
    void IFieldMergingCallback.ImageFieldMerging(ImageFieldMergingArgs args)
    {
        Shape shape = new Shape(args.Document);
        shape.Width = 1000;
        shape.Height = 2000;
        shape.WrapType = WrapType.Square;
        string imageFileName = "image.png";
        shape.ImageData.SetImage(imageFileName);
        args.Shape = shape;
    }
}

FindReplaceOptions class is extended with new properties

Related issue: WORDSNET-19912.

The following public properties were added to FindReplaceOptions class:

.NET

/// <summary>
/// Gets or sets a boolean value indicating either to ignore text inside delete revisions.
/// The default value is <c>false</c>.
/// </summary>
public bool IgnoreDeleted

.NET

/// <summary>
/// Gets or sets a boolean value indicating either to ignore text inside insert revisions.
/// The default value is <c>false</c>.
/// </summary>
public bool IgnoreInserted

.NET

/// <summary>
/// Gets or sets a boolean value indicating either to ignore text inside fields.
/// The default value is <c>false</c>.
/// </summary>
public bool IgnoreFields

Use Case 1. Explains how to ignore text inside delete revisions:

.NET

// Create new document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert non-revised text.
builder.Writeln("Deleted");
builder.Write("Text");

// Remove first paragraph with tracking revisions.
doc.StartTrackRevisions("author", DateTime.Now);
doc.FirstSection.Body.FirstParagraph.Remove();
doc.StopTrackRevisions();
Regex regex = new Regex("e");
FindReplaceOptions options = new FindReplaceOptions();

// Replace 'e' in document ignoring deleted text.
options.IgnoreDeleted = true;
doc.Range.Replace(regex, "*", options);
Console.WriteLine(doc.GetText());
 // The output is: Deleted\rT*xt\f

// Replace 'e' in document NOT ignoring deleted text.
options.IgnoreDeleted = false;
doc.Range.Replace(regex, "*", options);
Console.WriteLine(doc.GetText());
 // The output is: D*l*t*d\rT*xt\f
Use Case 2. Explains how to ignore text inside insert revisions:

.NET

// Create new document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert text with tracking revisions.
doc.StartTrackRevisions("author", DateTime.Now);
builder.Writeln("Inserted");
doc.StopTrackRevisions();

// Insert non-revised text.
builder.Write("Text");
Regex regex = new Regex("e");
FindReplaceOptions options = new FindReplaceOptions();

// Replace 'e' in document ignoring inserted text.
options.IgnoreInserted = true;
doc.Range.Replace(regex, "*", options);
Console.WriteLine(doc.GetText());
 // The output is: Inserted\rT*xt\f

// Replace 'e' in document NOT ignoring inserted text.
options.IgnoreInserted = false;
doc.Range.Replace(regex, "*", options);
Console.WriteLine(doc.GetText());
 // The output is: Ins*rt*d\rT*xt\f
Use Case 3. Explains how to ignore text inside fields:

.NET

// Create document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert field with text inside.
builder.InsertField("INCLUDETEXT", "Text in field");
Regex regex = new Regex("e");
FindReplaceOptions options = new FindReplaceOptions();

// Replace 'e' in document ignoring text inside field.
options.IgnoreFields = true;
doc.Range.Replace(regex, "*", options);
Console.WriteLine(doc.GetText());
 // The output is: \u0013INCLUDETEXT\u0014Text in field\u0015\f

// Replace 'e' in document NOT ignoring text inside field.
options.IgnoreFields = false;
doc.Range.Replace(regex, "*", options);
Console.WriteLine(doc.GetText());
 // The output is: \u0013INCLUDETEXT\u0014T*xt in fi*ld\u0015\f

No Separate DLLs for Xamarin Anymore

Starting with Aspose.Words 20.3 Xamarin support is changed. In earlier versions, we provide separate DLLs for Xamarin.Android, Xamarin.Mac and Xamarin.iOS. Now Xamarin developers can use Aspose.Words for .NET Standard in all mentioned platforms. According to the .NET Standard documentation, Aspose.Words for .NET Standard 2.0 can be used with Xamarin.iOS 10.14 or newer, Xamarin.Mac 3.8 or newer and with Xamarin.Android 8.0 or newer.

Removed obsolete DigitalSignature.Certificate property and CertificateHolder.Create(X509Certificate2) method

Related issue: WORDSNET-19999.

The following obsolete property of DigitalSignature class was removed:

.NET

/// <summary>
/// Returns the certificate object that was used to sign the document.
/// </summary>
[Obsolete("This method is obsolete. Please use CertificateHolder.Certificate instead.")]
public X509CertificateSystem Certificate

Please use the following property instead: CertificateHolder.Certificate


The following obsolete method of CertificateHolder class was removed:

.NET

/// <summary>
/// Creates CertificateHolder object using already created <see cref="X509Certificate2"/>.
/// The given <see cref="X509Certificate2"/> must have private key.
/// This method is obsolete and will be removed in the future releases.
/// </summary>
/// <param name="certificate">X509Certificate2 which contains private key.</param>
/// <returns>An instance of CertificateHolder</returns>
[Obsolete("Used for the compatibility with the public API which contains X509Certificate2. X509Certificate2 must have Private key and have the X509KeyStorageFlags.Exportable flag set.")]
public static CertificateHolder Create(X509Certificate2 certificate)

Please use the following methods instead: CertificateHolder.Create(Byte[], SecureString) CertificateHolder.Create(Byte[], String) CertificateHolder.Create(String, String) CertificateHolder.Create(String, String, String)

Supported dynamic stretching of an image within textbox bounds preserving the ratio of the image for LINQ Reporting Engine

Issue: WORDSNET-18362

The “Inserting Images Dynamically” section of the engine’s documentation was updated to describe the change.