Browse our Products

Aspose.Words for Java 18.7 Release Notes

Major Features

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

  • New typed (generic) collections and enumerators were introduced in Aspose.Words public API
  • Added public property HeaderFooterBookmarksExportMode in PdfSaveOptions 
  • Added FontSourceBase.GetAvailableFonts method 
  • Added public API for revision groups 
  • Introduced new comparison settings 
  • A new limo stretch algorithm for VML shapes rendering was developed, which most accurately repeats the output of MS Word (limo-stretched shapes)
  • Public property OutlineOptions.CreateOutlinesForHeadingsInTables added allowing to specify whether or not to create outlines for headings inside tables
  • Public method FontSourceBase.GetAvailableFonts added. It returns the list of fonts available via specific font source
  • Improved rendering of DrawingML shapes with specified parent object extents
  • EffectExtent attributes are now taken into account when calculating the bounding box for DrawingML shapes
  • Improved EMR_ALPHABLEND record handling while rendering metafiles
  • Now hidden shapes inside the group are not visible during rendering
  • Fixed the leading spaces handling while processing EMF+ DrawString records
  • Fixed a bug when grayscale effect was incorrectly applied to metafile
  • Fixed a bug with the graphic frame rendering (invalid frame layout on the page)
  • Fixed rendering of shadow effect for transparent shapes
  • Fixed a bug with rendering of the MathML object if balanceSingleByteDoubleByteWidth property and UseFELayout property are specified
  • Improved rendering of \0 characters
  • Improved column balancing when column has footnotes
  • Improved handling of table grid when layout is changed programmatically
  • Improved table breaking in 2013 mode when it overlaps footer
  • Improved handling of “don’t add space between paragraphs of the same style” option when only one of the paragraphs have this option set
  • Fixed issue when hanging punctuation precedes inline shape
  • Fixed issue when Kinsoku rule is analyzed for shapes

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
WORDSJAVA-1533Document.Compare does not work correctly for list itemsBug
WORDSJAVA-1581Opening embedded Visio Drawing issueBug
WORDSJAVA-1589Incorrect page number in footerBug
WORDSJAVA-1590Incorrect page number reflecting in footerBug
WORDSJAVA-1712MS Word hangs and is unable to display ChartBug
WORDSJAVA-1773Metafile Optimizer doesn’t work for PathGradientBrushTransform.Bug
WORDSJAVA-1831Fonts are improperly substituted on Linux environmentBug
WORDSJAVA-1841Package com.aspose.words.ref is not exported in the Manifest.MFBug
WORDSJAVA-1797ReportingEngine.buildReport throws java.lang.ExceptionInInitializerErrorException
WORDSJAVA-1816SetLicense throws org.xml.sax.SAXParseExceptionException
WORDSJAVA-1824License.setLicense throws org.xml.sax.SAXParseExceptionException
WORDSJAVA-1802TestReportingIntegration.testLink() failed after the last release.Regression
WORDSJAVA-1829Yen Currency formatting on MERGEFIELD does not workRegression
WORDSNET-16939AW doesn’t break floater table aligned bottom to marginBug
WORDSNET-16940AW incorrect split floating tables with position near page bottomBug
WORDSNET-14972Table moves at the end of first page in PDFBug
WORDSNET-13316Paragraph is moved to previous page after conversion from Docx to PdfBug
WORDSNET-11986Width of table in footer goes beyond the right page edge in PDFBug
WORDSNET-16998A Drawing (GroupShape) darkens in generated PDFBug
WORDSNET-16758A white div overlaps the content in generated HtmlFixedBug
WORDSNET-17050AltChunk data is removed after re-saving DOCXBug
WORDSNET-17029Arrow detaches when converting DOCX to DOCXBug
WORDSNET-16951Content Controls not Preserved during Converting XML to PDFBug
WORDSNET-16632Content overlaps in generated PDFBug
WORDSNET-14359Doc to FlatOpc conversion issue with themeBug
WORDSNET-16922Document is corrupted after saving DOCX to DOCBug
WORDSNET-15286Document.Compare does not work correctly for list itemsBug
WORDSNET-16917Document.Compare generates the corrupted documentBug
WORDSNET-17024DOCX to DOC - error when openingBug
WORDSNET-16976DOCX to PDF - hidden element is renderedBug
WORDSNET-16472DOCX to PDF Issue with Image size and alignmentsBug
WORDSNET-12540Docx to PDF/Tiff conversion issue with Shape(textbox) positionBug
WORDSNET-16848DOCX to RTF conversion issue with list labelBug
WORDSNET-16747EMF rendering // Incorrect rendering of a Visio.Drawing.15 object in PDFBug
WORDSNET-16736EMF rendering // MS Visio Drawing Object renders incorrectly in PDFBug
WORDSNET-17028EsShapeReader fails at Debug.FailBug
WORDSNET-16943Font is changed from “Calibri” to “Times New Roman” in output PDFBug
WORDSNET-16910Font size of cell’s text is changed in output PDFBug
WORDSNET-16805Formula cant be rendered correctly after converted to pdfBug
WORDSNET-15165Image’s position is changed after conversion from RTF to PDFBug
WORDSNET-16591InsertDocument does not insert Headers Footers from multiple SectionsBug
WORDSNET-16730Inserting Radio Buttons as HTML into the Document adds two extra spaces at the beginningBug
WORDSNET-16983Labels in picture misplaced in PDFBug
WORDSNET-16639Limo stretch // Shapes in GroupShape skewed when renderingBug
WORDSNET-16899Line break in Cell occurs at wrong characterBug
WORDSNET-14641MathML is exported incorrectly in output DocxBug
WORDSNET-14343mathml notation problem during converting html to word - mtextBug
WORDSNET-16851MathML object having no revisions is enclosed in <ins> and <del> elements during export to HTMLBug
WORDSNET-16920Microsoft Edge browser does not open EPUB correctlyBug
WORDSNET-16981Picture truncates from right in PDFBug
WORDSNET-16617Remove the scaling in SVG exportBug
WORDSNET-15424Right-aligned tab-stops conversion issue in resultant MHTMLBug
WORDSNET-16219RunPr.LocaleIdFarEast is not populatedBug
WORDSNET-3977Shape is rendered improperly and looks very badBug
WORDSNET-16802Shape’s color is lost after rendering DOCX to PDFBug
WORDSNET-16898Shape’s text is rendered on next line in output DOC/PDFBug
WORDSNET-17021Shapes with unequal extent and xfrm.ext are rendered incorrect after converting to PDFBug
WORDSNET-16828SVG size inconsistent between Word document on Windows and MACBug
WORDSNET-15088Table’s contents are changed after re-saving OdtBug
WORDSNET-16872The compared output contains table with the misaligned table header.Bug
WORDSNET-17035The font size is changed in PDF output documentBug
WORDSNET-17016The last line on the first page has been moved to the second one.Bug
WORDSNET-17034The source WordML is improperly uploadedBug
WORDSNET-17000Unexpected colors appear in generated PDFBug
WORDSNET-5836While doc to Pdf, Text rendered with incorrect formatBug
WORDSNET-16616Add support for the MathML “mathcolor” attributeEnhancement
WORDSNET-10424Docx to WordML conversion issue with HyperlinksEnhancement
WORDSNET-16936Improve Aspose.Words trial mode messageEnhancement
WORDSNET-16614Improve support for MathML elements <menclose>, <mtext>, and for the “mathcolor” attributeEnhancement
WORDSNET-9014Incorrect shape height causes unnecessary text wrapping in AW outputEnhancement
WORDSNET-17059Aspose.Words.UnsupportedFileFormatException is thrown while loading DOCXException
WORDSNET-16829Document.PageCount throws System.NullReferenceExceptionException
WORDSNET-16970Exception occurs when calling Document.PageCount and UpdatePageLayoutException
WORDSNET-16847SetLicense throws System.InvalidOperationExceptionException
WORDSNET-16996System.NullReferenceException is thrown while converting Docx to HTMLException
WORDSNET-16819System.NullReferenceException is thrown while saving DOC to HtmlFixedException
WORDSNET-16804System.NullReferenceException occurs upon calling UpdatePageLayout methodException
WORDSNET-16954Unhandled Exception: System.ArgumentNullExceptionException
WORDSNET-16731Add ability to get all fonts names from FontSourceFeature
WORDSNET-15784Add feature to get the start position of text for list itemsFeature
WORDSNET-16806Add more Comparison Settings to CompareOptionsFeature
WORDSNET-9079Add support in PdfSaveOptions to export bookmarks of header/footerFeature
WORDSNET-16914API for removing personal information setting from the documentFeature
WORDSNET-16955Create outlines for heading style paragraphs inside tableFeature
WORDSNET-16965Export hyperlinks using <w:hyperlink> instead of using complex fieldsFeature
WORDSNET-17070Public interface for revision groupsFeature
WORDSNET-14858Spaces in a text file are truncated in output documentFeature
WORDSNET-17005BMP and PNG images are not scaled down in size when HTML is converted to PDF/DOCX`Regression
WORDSNET-17030Document.Clone method keeps the reference on original documentRegression
WORDSNET-16975Yen Currency formatting on MERGEFIELD does not workRegression

Public API and Backward Incompatible Changes

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

Added API for Revision Groups

A revision in Aspose.Words is a change in one document node. A set of sequential revisions of the same type in adjacent document nodes forms a revision group. Similar revision groups are displayed in the Reviewing Pane of MS Word.

The new public RevisionGroupCollection and RevisionGroup classes have been added. Also the RevisionCollection.Groups property has been implemented.

/// <summary>
/// A collection of <see cref="RevisionGroup"/> objects that represent revision groups in the document.
/// </summary>
public sealed class RevisionGroupCollection : IEnumerable<RevisionGroup>
{
    /// <summary>
    /// Returns a revision group at the specified index.
    /// </summary>
    public RevisionGroup this[int index] { get; }
    /// <summary>
    /// Returns the number of revision groups in the collection.
    /// </summary>
    public int Count { get; }
}
/// <summary>
/// Represents a group of sequential <see cref="Revision" /> objects.
/// </summary>
public class RevisionGroup
{
    /// <summary>
    /// Gets the type of revisions included in this group.
    /// </summary>
    public RevisionType RevisionType { get; }
    /// <summary>
    /// Gets the author of this revision group.
    /// </summary>
    public string Author { get; }
    /// <summary>
    /// Returns inserted/deleted/moved text or description of format change.
    /// </summary>
    public string Text { get; }
}
public class RevisionCollection : IEnumerable<Revision>
{
    /// <summary>
    /// Collection of revision groups.
    /// </summary>
    public RevisionGroupCollection Groups { get; }
}

UC

Document doc = new Document(myDir + "Document1.docx");
foreach (RevisionGroup group in doc.Revisions.Groups)
{
    Console.WriteLine("{0}, {1}:", group.Author, group.RevisionType);
    Console.WriteLine(group.Text);
}

Generics

Untyped containers like ArrayList have been replaced with typed containers like List<T>. As a result some public API becomes changed.

1. MailMerge

Before:

/// <summary>
/// Returns a collection of mail merge regions with the specified name.
/// </summary>
/// <param name="regionName">Region name (case-insensitive).</param>
/// <returns>The list of regions.</returns>
public ArrayList GetRegionsByName(string regionName)
{
...
}

After:

public IList<MailMergeRegionInfo> GetRegionsByName(string regionName)
{
...
}

2. MailMergeRegionInfo

Before:

/// <summary>
/// Returns a list of child regions.
/// </summary>
public ArrayList Regions
{
    get { return mChildRegions; }
}

After:

public IList<MailMergeRegionInfo> Regions
{
    get {...}
}

3. MailMergeRegionInfo

Before:

/// <summary>
/// Returns a list of child merge fields.
/// </summary>
public ArrayList Fields
{
    get { return mChildFields; }
}

After:

public IList<FieldMergeField> Fields
{
    get { return mChildFields; }
}

4. DocumentInfo

Before:

/// <summary>
/// Gets or sets custom properties of the document.
/// </summary>
public SortedStringList CustomProperties
{
    get { return mCustomProperties; }
    set { mCustomProperties = value; }
}

After:

/// <summary>
/// Gets or sets custom properties of the document.
/// </summary>
public SortedStringListGeneric<object> CustomProperties
{
    get { return mCustomProperties; }
    set { mCustomProperties = value; }
}

5. BorderCollection

Before:

public sealed class BorderCollection : IEnumerable

After:

public sealed class BorderCollection : IEnumerable<Border>

6. DigitalSignatureCollection

Before:

public class DigitalSignatureCollection : IEnumerable

After:

public class DigitalSignatureCollection : IEnumerable<DigitalSignature>

7. VariableCollection

Before:

public class VariableCollection : IEnumerable

After:

public class VariableCollection : IEnumerable<KeyValuePair<string, string>>

8. WarningInfoCollection

Before:

public class WarningInfoCollection : IWarningCallback, IEnumerable

After:

public class WarningInfoCollection : IWarningCallback, IEnumerable<WarningInfo>

9. ChartDataLabelCollection

Before:

public class ChartDataLabelCollection : IEnumerable

After:

public class ChartDataLabelCollection : IEnumerable<ChartDataLabel>

10. ChartDataPointCollection

Before:

public class ChartDataPointCollection : IEnumerable

After:

public class ChartDataPointCollection : IEnumerable<ChartDataPoint>

11. ChartSeriesCollection

Before:

public class ChartSeriesCollection : IEnumerable

After:

public class ChartSeriesCollection : IEnumerable<ChartSeries>

12. Type of DmlChartDataLabelAttrs.Extensions property changed.

Before:

StringToObjDictionary

After:

StringToObjDictionary<DmlExtension>

13. ListCollection

Before:

public class ListCollection : IEnumerable

After:

public class ListCollection : IEnumerable<List>

14. ListLevelCollection

Before:

public class ListLevelCollection : IEnumerable

After:

public class ListLevelCollection : IEnumerable<ListLevel>

15. CustomPartCollection

Before:

public class CustomPartCollection : IEnumerable

After:

public class CustomPartCollection : IEnumerable<CustomPart>

16. CustomXmlPartCollection

Before:

public class CustomXmlPartCollection : IEnumerable

After:

public class CustomXmlPartCollection : IEnumerable<CustomXmlPart>

17. CustomXmlPropertyCollection

Before:

public class CustomXmlPropertyCollection : IEnumerable

After:

public class CustomXmlPropertyCollection : IEnumerable<CustomXmlProperty>

18. CustomXmlSchemaCollection

Before:

public class CustomXmlSchemaCollection : IEnumerable

After:

public class CustomXmlSchemaCollection : IEnumerable<string>

19. SdtListItemCollection

Before:

public class SdtListItemCollection : IEnumerable

After:

public class SdtListItemCollection : IEnumerable<SdtListItem>

20. CompositeNode

Before:

public abstract class CompositeNode : Node, IEnumerable, INodeCollection

#if !JAVA

  // XPath navigation is supported on Java, but implementing this interface is not needed.
        , IXPathNavigable

#endif

After:

public abstract class CompositeNode : Node, IEnumerable<Node>, INodeCollection

#if !JAVA

  // XPath navigation is supported on Java, but implementing this interface is not needed.
        , IXPathNavigable

#endif

21. NodeCollection

Before:

public class NodeCollection : INodeCollection, IEnumerable

After:

public class NodeCollection : INodeCollection, IEnumerable<Node>

22. NodeList

Before:

public class NodeList : IEnumerable

After:

public class NodeList : IEnumerable<Node>

23. DocumentPropertyCollection

Before:

public abstract class DocumentPropertyCollection : IEnumerable

After:

public abstract class DocumentPropertyCollection : IEnumerable<DocumentProperty>

24. RevisionCollection

Before:

public class RevisionCollection : IEnumerable

After:

public class RevisionCollection : IEnumerable<Revision>

25. BookmarksOutlineLevelCollection

Before:

public class BookmarksOutlineLevelCollection : IEnumerable

After:

public class BookmarksOutlineLevelCollection : IEnumerable<KeyValuePair<string, int>>

26. OdsoFieldMapDataCollection

Before:

public class OdsoFieldMapDataCollection : IEnumerable

After:

public class OdsoFieldMapDataCollection : IEnumerable<OdsoFieldMapData>

27. OdsoRecipientDataCollection

Before:

public class OdsoRecipientDataCollection : IEnumerable

After:

public class OdsoRecipientDataCollection : IEnumerable<OdsoRecipientData>

28. StyleCollection

Before:

public class StyleCollection : IEnumerable

After:

public class StyleCollection : IEnumerable<Style>

Added Public Property HeaderFooterBookmarksExportMode in PdfSaveOptions

WORDSNET-9079 has now been resolved.

/// <summary>
/// Determines how bookmarks in headers/footers are exported.
/// </summary>
/// <remarks>
/// The default value is <see cref="Aspose.Words.Saving.HeaderFooterBookmarksExportMode.All"/>.
/// </remarks>
public HeaderFooterBookmarksExportMode HeaderFooterBookmarksExportMode { get; set; }
/// <summary>
/// Specifies how bookmarks in headers/footers are exported.
/// </summary>
public enum HeaderFooterBookmarksExportMode
{
    /// <summary>
    /// Bookmarks in headers/footers are not exported.
    /// </summary>
    None,
    /// <summary>
    /// Only bookmark in first header/footer of the section is exported.
    /// </summary>
    First,
    /// <summary>
    /// Bookmarks in all headers/footers are exported.
    /// </summary>
    All
}

Added FontSourceBase.GetAvailableFonts Method

WORDSNET-16731 has now been resolved. This method returns the list of fonts available via specific font source.

/// <summary>
/// Returns list of fonts available via this source.
/// </summary>
public IList<PhysicalFontInfo> GetAvailableFonts();
/// <summary>
/// Specifies information about physical font available to Aspose.Words font engine.
/// </summary>
public class PhysicalFontInfo
{
    /// <summary>
    /// Family name of the font.
    /// </summary>
    public string FontFamilyName { get; }
    /// <summary>
    /// Full name of the font.
    /// </summary>
    public string FullFontName { get; }
    /// <summary>
    /// Version string of the font.
    /// </summary>
    public string Version { get; }
    /// <summary>
    /// Path to the font file if any.
    /// </summary>
    public string FilePath { get; }
}

Introduced new Comparison Settings

WORDSNET-16806 has now been resolved. The following settings were added to the CompareOptions class:

/// <summary>
/// True indicates that documents comparison is case insensitive.
/// By default comparison is case sensitive.
/// </summary>
public bool IgnoreCaseChanges
/// <summary>
/// Specifies whether to compare the differences in data contained in tables.
/// By default tables are not ignored.
/// </summary>
public bool IgnoreTables
/// <summary>
/// Specifies whether to compare differences in fields.
/// By default fields are not ignored.
/// </summary>
public bool IgnoreFields
/// <summary>
/// Specifies whether to compare differences in footnotes and endnotes.
/// By default footnotes are not ignored.
/// </summary>
public bool IgnoreFootnotes
/// <summary>
/// Specifies whether to compare differences in comments.
/// By default comments are not ignored.
/// </summary>
public bool IgnoreComments
/// <summary>
/// Specifies whether to compare differences in the data contained within text boxes.
/// By default textboxes are not ignored.
/// </summary>
public bool IgnoreTextboxes

These options were created according to appropriate analogs in the “Compare Documents” dialog in the MS Word:

  1. «Case changes»;
  2. «Tables»;
  3. «Fields»;
  4. «Footnotes and endnotes»;
  5. «Comments»;
  6. «Textboxes».

Usage:

Document docA = new Docment(myDir + "TestA.docx");
Document docB = new Document(myDir + "Test.docx");
CompareOptions options = new CompareOptions();
options.IgnoreTables = true;
docA.Compare(docB, "am", DateTime.Now, options);

Added Public Property TxtLoadOptions.DetectNumberingWithWhitespaces

WORDSNET-14858 has been resolved.

A public property TxtLoadOptions.DetectNumberingWithWhitespaces was introduced instead of previously used LoadOptions.AllowTrailingWhitespaceForListItems. LoadOptions.AllowTrailingWhitespaceForListItems is obsolete property now.

/// <summary>
/// Allows to specify how numbered list items are recognized when document is imported from plain text format.
/// The default value is true.</summary>
/// <remarks>
/// <para> If this option is set to false, lists recognition algorithm detects list paragraphs, when list numbers ends with
/// either dot, right bracket or bullet symbols (such as "•", "*", "-" or "o").</para>
/// <para> If this option is set to true, whitespaces are also used as list number delimeters:
/// list recognition algorithm for Arabic style numbering (1., 1.1.2.) uses both whitespaces and dot (".") symbols.</para>
/// </remarks>
public bool DetectNumberingWithWhitespaces

UC:

TxtLoadOptions loadOptions = new TxtLoadOptions();
loadOptions.DetectNumberingWithWhitespaces = false;
Document doc = new Document(fileName, loadOptions);

API for Removing Personal Information Setting from Document

WORDSNET-16914 has been resolved. We have added new public option

bool Document.RemovePersonalInformation

Important note: Setting this option does not actually remove personal information while document is processed in Aspose.Words and affects only Microsoft Word behavior.

TxtLoadOptions Class was Extended

WORDSNET-14858 has been resolved. A new LoadOptions class for dealing with the text files was introduced : TxtLoadOptions.

New public properties LeadingSpacesOptions and TrailingSpacesOptions were added into the TxtLoadOptions class:

/// <summary>
/// Gets or sets preferred option of a trailing space handling.
/// Default value is <see cref="TxtTrailingSpacesOptions.Trim"/>.
/// </summary>
public TxtTrailingSpacesOptions TrailingSpacesOptions
/// <summary>
/// Gets or sets preferred option of a leading space handling.
/// Default value is <see cref="TxtLeadingSpacesOptions.ConvertToIndent"/>.
/// </summary>
public TxtLeadingSpacesOptions LeadingSpacesOptions

These properties allows to control  the way of handling leading and trailing spaces during loading txt file.

Leading spaces could be trimmed, preserved or converted to indent (Please see TxtLeadingSpacesOptions enum). Trailing spaces could be trimmed or preserved.

UC:

TxtLoadOptions loadOptions = new TxtLoadOptions();
loadOptions.LeadingSpacesOptions = TxtLeadingSpacesOptions.Trim;
loadOptions.TrailingSpacesOptions = TxtTrailingSpacesOptions.Trim;
Document doc = new Document(fileName, loadOptions);

Obsolete Method RemoveUnusedResources() was Removed from Document Class

Obsolete method RemoveUnusedResources() was removed from Document class. Please use Document.Cleanup() method instead.

Obsolete Method SetImage() was Removed from ImageData Class

Obsolete method SetImage() was removed from ImageData class. Please use the ImageBytes property to set an image.

Obsolete Property MirrorMargins was Removed from PageSetup Class

Obsolete property MirrorMargins was removed from PageSetup class. Please use the MultiplePages property to set MultiplePagesType.