Aspose.Words for .NET 22.2 Release Notes

Major Features

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

  • AZW3 format (KF8 is another name of the format) is now supported for loading.
  • Added an ability to get custom field data which is associated with the field.
  • Saving progress notifications were extended for HTML-based and XAML-based flow formats.
  • Provided an ability to convert Shapes to SVG images upon export to HTML, MHTML or EPUB.
  • Implemented list numbering export to PDF logical structure.

Full List of Issues Covering all Changes in this Release (Reported by .NET Users)

WORDSNET-9675Layout of the document is incorrect: paragraph justify and table gridsNew Feature
WORDSNET-23235Consider adding an html save option to export shapes as SVG.New Feature
WORDSNET-11377DOCX to PDF conversion issue with table renderingNew Feature
WORDSNET-22411Add support for loading of AZW3 (Kindle KF8) format documentsNew Feature
WORDSNET-18936Implement performance loggerNew Feature
WORDSNET-23319Add saving progress notificationNew Feature
WORDSNET-6683UpdateTablelayout resizes the cell widths incorrectlyBug
WORDSNET-7379Table layout issue on converting DOCM to PDFBug
WORDSNET-22735Content are lost after DOCX to PDF conversionBug
WORDSNET-8933DOCX to PDF conversion issue with table renderingBug
WORDSNET-10113Table width is changed after conversion from DOC to fixed file formatBug
WORDSNET-13360Table’s cell contents are wrapped to next line in output PDFBug
WORDSNET-14846An image and the text are bunched together with no padding in PDFBug
WORDSNET-15766Document layout differs from WordBug
WORDSNET-15846The document content corrupted after PDF renditionBug
WORDSNET-23364Text is justified improperlyBug
WORDSNET-16375Table width is decreased after conversion from DOCX to PDFBug
WORDSNET-17446Table column content truncated in generated PDFBug
WORDSNET-15380A word splits and renders on two linesBug
WORDSNET-12200Table column widths are not correct in PDF/HTMLBug
WORDSNET-20685Content are push down to page after DOCX to PDF conversionBug
WORDSNET-19395Document.PageCount returns incorrect value after saving documentBug
WORDSNET-18786Document.PageCount returns incorrect page countBug
WORDSNET-13803Table’s width is changed after conversion from DOCX to PDFBug
WORDSNET-12869DOC to XPS conversion issue with image renderingBug
WORDSNET-20844Table layout does not match WordBug
WORDSNET-20578Table corruption during Word to PDF conversionBug
WORDSNET-22074Image logo and text moved toward left side of page in output PDFBug
WORDSNET-9035“Automatically resize to fit contents” table option does not work during converting to PDFBug
WORDSNET-23214Table is rendered improperlyBug
WORDSNET-21626Narrowing of Table columns cause increase in Table heights and an extra page in PDFBug
WORDSNET-18661Imitate MS Word logic of table grid calculation for auto-fit tables with cells spanning multiple columnsBug
WORDSNET-10721A floating table partially renders beyond left/right page margins in PDFBug
WORDSNET-14064Table’s width is changed after conversion from DOCX to PDFBug
WORDSNET-22424Table AutoFit not working While converting From Word To PDFBug
WORDSNET-14634Table’s width shrinks when two cells are mergedBug
WORDSNET-15755Difference in number of pages between Aspose.Words and MS Word generated PDFBug
WORDSNET-20687DOCX to PDF conversion issue with Table headerBug
WORDSNET-20686Cell Content are rendered on two lines after DOCX to PDF conversionBug
WORDSNET-23244Improve single-path frame DML WordArt renderingBug
WORDSNET-15017Table and cell width is changed in output PdfBug
WORDSNET-9595Calling UpdateTableLayout makes table widths incorrectBug
WORDSNET-17060Wrong Table column width in PDF export when mixing millimeter and percent widthsBug
WORDSNET-23272Add ListNumbering attribute to the PDF logical structureBug
WORDSNET-22689Table cell width increased in Aspose PDFBug
WORDSNET-22898Incorrect table column widths on conversion to PDFBug
WORDSNET-23312Some content is pushed to the previous page after converting DOCX to PDFBug
WORDSNET-15845Pages with landscape orientation trimmed after PDF renditionBug
WORDSNET-837Table layout algorithm does not work for “merged cells” that are simply wideBug
WORDSNET-18698Curved text is not rendered correctlyBug
WORDSNET-23339Oval shape with text is wrapped improperlyBug
WORDSNET-23344Consider exporting hyperlink screentip as alternative text to PDF logical structureBug
WORDSNET-23185Lost table while convert from PDF to MDBug
WORDSNET-19160OfficeMath renders incorrectly in output EMFBug
WORDSNET-22056Unwanted revisions are appeared after re-saving DOCBug
WORDSNET-23178InvalidOperationException: End of stream while reading literal stringBug
WORDSNET-21070Support Widow/Orphan paragraph rule for the first line in a column when footnotes balancingBug
WORDSNET-23374Custom footnote missed while converting from PDF to Word documentBug
WORDSNET-22522Table Error! No text of specified style in document after appending documentsBug
WORDSNET-23206Incorrect text of the legend items of the PieChartBug
WORDSNET-21384Embedded graphs are rendered wrong when saving to PDFBug
WORDSNET-23359“The document appears to be corrupted and cannot be loaded.” exception when opening ODT fileBug
WORDSNET-23340An exception occurs when open ODT documentBug
WORDSNET-23236Fix accuracy tests keeping failingBug
WORDSNET-23238Missing some contents after converting PDF to DOCXBug
WORDSNET-23315Custom document property cannot be retrieved from the PDF generated by Aspose.WordsBug
WORDSNET-23347Out of memory exception when creating custom XMLBug
WORDSNET-23387Alignment of the equation changed after converting a DOCX to PDFBug
WORDSNET-20819Exception was thrown: Could not create the bitmap with the specified parametersBug
WORDSNET-23392No way to apply Style to ApplyFont in FindReplaceOptionsBug
WORDSNET-22818Text formatting is italicized in the PDFBug
WORDSNET-22826Chart X-Axis are changed after DOCX to PDF ConversionBug
WORDSNET-23256DOCX to PDF conversion issue with page number rendering in footerBug
WORDSNET-23258IReplacingCallback is called before processing FindWholeWordsOnly optionBug
WORDSNET-23262Repeating table header is rendered improperlyBug
WORDSNET-23265PDF import takes a lot of timeBug
WORDSNET-23270WordArt glyphs are rendered with an extra outlineBug
WORDSNET-23029NullReferenceException at PdfContext.ProcessCrossReferenceStreamBug
WORDSNET-23179NullReferenceException at FootnoteDetector.AddSegmentToFootnotesBug
WORDSNET-23157OutOfMemoryException is thrown upon updating fieldsBug
WORDSNET-23274Paragraph space after is changed in diagram after open/save DOCX documentBug
WORDSNET-23199InvalidOperationException: Cannot read AES initialization vectorBug
WORDSNET-23036IndexOutOfRangeException at PdfUnfilteredStream.ApplyFiltersBug
WORDSNET-23202InvalidOperationException in CffReader.ReadOffsetsBug
WORDSNET-23207InvalidOperationException at PdfStream.ToByteArrayBug
WORDSNET-23044Fix row detection issues on OCR Table.pngBug
WORDSNET-23281Footnote paragraphs are brokenBug
WORDSNET-23034InvalidOperationException: Unexpected nested BT operatorBug
WORDSNET-23284The end-of-cell marker has been removed and revisions have changed when creating custom XMLBug
WORDSNET-23287Aspose.Words produces invalid document after DOCX to DOCX to DOCM conversionBug
WORDSNET-23307Footnote contains original reference nameBug
WORDSNET-23309Repair OCR in Aspose.Apps project before next website releaseBug
WORDSNET-23205InvalidOperationException: Page content invalid at PdfPage.get_Contents()Bug
WORDSNET-23318Formatting is lost after open/save DOC fileBug
WORDSNET-23233File can no be re-savedBug
WORDSNET-23308Missing bookmarks in DOCX to PDF conversionBug
WORDSNET-22504PDF size comparison between .NET framework and .NET CoreBug

Full List of Issues Covering all Changes in this Release (Reported by Java Users)

WORDSNET-23326Tables are rendered with incorrect column widthsNew Feature
WORDSNET-17734DOCX to PDF conversion issue with table and images renderingNew Feature
WORDSNET-23198Make FieldData property publicNew Feature
WORDSNET-21135Different table widths in resultant fileBug
WORDSNET-21082Aspose Saved DOCX Converted to PDF Suppresses First Column from TableBug
WORDSNET-21921Number is wrapped to next line in table cell after DOCX to PDF conversionBug
WORDSNET-20549More rows rendered on first Page causing lesser total pages in PDFBug
WORDSNET-17015DOCX to PDF - incorrect table cell widthBug
WORDSNET-22779Document Compare changes the list numbersBug
WORDSNET-22926NullReferenceException is thrown on updating layoutBug
WORDSNET-23170RTF to HTML conversion issue with List labelsBug
WORDSNET-23299ArgumentException is thrown while inserting documentBug
WORDSNET-23305Redundant table format revision is renderedBug
WORDSNET-22785Elements overlap when converting DOC to PDF with JavaBug

Public API and Backward Incompatible Changes

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

Added FieldStart.FieldData property

Related issue: WORDSNET-23198

The following public property is added to FieldStart class:

/// <summary>
/// Gets custom field data which is associated with the field.
/// </summary>
public byte[] FieldData { get; }

Use Case:

Document doc = new Document(fileName);
Field field = doc.Range.Fields[0];

Added HtmlSaveOptions.SaveShapesAsSvg public property

Related issue: WORDSNET-23235

The following public property is added to HtmlSaveOptions class:

/// <summary>
/// Controls whether <see cref="Drawing.Shape"/> nodes are converted to SVG images when saving to HTML, MHTML or EPUB.
/// Default value is <c>false</c>.
/// </summary>
/// <remarks>
/// <para>
/// If this option is set to <c>true</c>, <see cref="Drawing.Shape"/> nodes are exported as &lt;svg&gt; elements.
/// Otherwise, they are rendered to bitmaps and are exported as &lt;img&gt; elements.
/// </para>
/// <para>
/// Note that this options also affects text boxes, because they are represented by <see cref="Drawing.Shape"/> nodes.
/// As a result, if this option is set to <c>true</c>, it overrides the <see cref="ExportTextBoxAsSvg"/> property
/// value and causes text boxes to be converted to SVG.
/// </para>
/// </remarks>
public bool ExportShapesAsSvg
    get { return mSaveImageOptions.ShapesAsSvg; }
    set { mSaveImageOptions.ShapesAsSvg = value; }

Use Case:

Document doc = new Document(fileName);
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
saveOptions.ExportShapesAsSvg = true;
doc.Save(outputFileName, saveOptions);

AZW3 format is now supported for loading

Related issue: WORDSNET-22411

Aspose.Words can now load AZW3 documents (KF8 is another name of the format). Usually, documents in the AZW3 format have the “.azw3” or “.mobi” extension. However, a “.mobi” document may be in the older MOBI format, and some “.mobi” documents contain two versions of content - MOBI and AZW3 - for backward compatibility.

The following table explains what reader Aspose.Words uses to load MOBI and AZW3 documents in different cases:


Currently, Aspose.Words always loads all topics from an AZW3 document in the order in which they appear in the table of contents.

The following publicly visible enum values were added:


The FileFormatUtil class can now be used to determine if a file is an AZW3 document. For example, the following call

FileFormatInfo info = FileFormatUtil.DetectFileFormat("book.azw3");

will return an info instance with the FileFormatInfo.LoadFormat property set to LoadFormat.Azw3.

Currently, no load options have effect when loading AZW3 documents. LoadOptions.ResourceLoadingCallback is not invoked when loading AZW3 documents, because Aspose.Words expects all referenced resource files to be stored locally in the AZW3 document. Like in the Kindle reader, references to external resource files are ignored.

As a result, the only use cases for loading AZW3 documents that is currently available is the one illustrated below:

Document doc = new Document("book.azw3");

Enabled saving progress notifications for HTML-based and XAML-based flow formats

Related issue: WORDSNET-23319

The SaveOptions.ProgressCallback is now also invoked when saving to the following HTML-based and XAML-based flow formats: Html, Mhtml, Epub, XamlFlow, and XamlFlowPack.

Breaking change – explicit Table.AutoFit() call may be required to make table structure match the specified cell widths in a builder scenario

A major update that handles tables with incorrect or missing column width data in the source document is released in Aspose.Words 22.2.

Cell/column width data and the number of columns spanned by a cell are re-calculated from table and cell properties. Column width data stored in the document are replaced by re-calculated values.

The algorithm imitates MS Word logic that does not use cell widths. (In fact, cell width is not even stored in .DOCX format used by MS Word).

The new logic may change the output for some document builder scenarios. In the following example the number of columns spanned by the cell in row 2 is no longer calculated automatically from the specified cell widths:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// First row

Cell cell1 = builder.InsertCell();
cell1.CellFormat.Width = 100;
builder.Write("Text in cell 1.");

Cell cell2 = builder.InsertCell();
cell2.CellFormat.Width = 100;
builder.Write("Text in cell 2.");

// End of first row

// Second row
Cell cell3 = builder.InsertCell();
cell3.CellFormat.Width = 200;
builder.Write("Row 2 cell spans 2 columns.");

// End of second row


The behavior was changed because cell width data proved to be unreliable in a number of generated documents.

In order to preserve the specified cell widths in the above scenario and calculate the number of columns spanned by a cell from cell width, Aspose.Words should be explicitly instructed by calling Table.AutoFit() method:

Table table = builder.EndTable();

// Re-calculate table structure from the specified cell widths.

This will also set table layout to fixed, which is better suited for preserving cell widths regardless of contents.

Removed obsolete property FieldXE.HasPageRangeBookmarkName

Removed obsolete property FieldXE.HasPageRangeBookmarkName. Please, use the FieldXE.PageRangeBookmarkName property instead.