Browse our Products

Aspose.Words for Java 17.3.0 Release Notes

Major Features

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

  • Added public API to insert online video via DocumentBuilder.InsertOnlineVideo
  • Added functionality to set thread-local (and Aspose.Words application only) Locale and TimeZone. CurrentThreadSettings public API class added for this.
  • New public OfficeMath properties: MathObjectType, Justification, DisplayType
  • Full support for Word 2013 documents (roundtrip to/from DOCX)
  • Variables support and more new features are introduced in LINQ Reporting Engine.
  • Font substitution mechanism improved. Now Aspose.Words evaluates all related fields in FontInfo (Panose, Sig etc) and finds the closest match among the available font sources.
  • Asian font rendering improved (more precise metrics calculation).
  • Stroke weight is now taken into account while rendering auto-sized Textboxes.
  • Implemented next round of improvements in table grid algorithm.
  • Improved table breaking logic in compatibility mode for tables with header rows.
  • Improved table breaking logic for tables with nested tables in a cell with bottom margin set.
  • Improved tables breaking logic for tables with vertically merged cells having horizontal borders.
  • Implemented fitText option for table cells.

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
WORDSJAVA-1497Generated document contains data of another document in multi-threading environmentBug
WORDSJAVA-1485Adding FontSettings Object to Document Corrupts ImagesBug
WORDSJAVA-1479Font of very small font size is not rendered.Enhancement
WORDSJAVA-1477InsertOnlineVideoFeature
WORDSJAVA-1426Contents are rendered on previous page in output PdfBug
WORDSNET-12059Paragraph formatting is lost after re-saving DocxBug
WORDSNET-13034Underline/strikethrough formatting is applied to revisions imported from HTMLBug
WORDSNET-13060/tcFitText/ Conversion of table creates new line inside tableBug
WORDSNET-13111Compare and Reject feature do not mimic Microsoft Word’s behaviorBug
WORDSNET-13204/nested row break height/Text moves to previous pages after conversion from Docx to PdfBug
WORDSNET-13765/fitText/ Chinese text render on next line in HtmlFixedBug
WORDSNET-13887/table break header row/ Converting from .docx to .pdf loses table headerBug
WORDSNET-14241/table break header row/ Table is rendered on previous page after conversion form Docx to PdfBug
WORDSNET-14448Table header moves to previous page bottom in PDFBug
WORDSNET-14499EndnoteOptions are not saved if the document does contain endnotesBug
WORDSNET-14559/table break/ All pages show some content from next page at bottom in PDFBug
WORDSNET-14588Paragraph’s spacing is changed when InsertDocument is used with UseDestinationStyles modeBug
WORDSNET-14635Hebrew date field renders incorrectly in PdfBug
WORDSNET-14655Incorrect formatting of ‘Normal (Web)’ after import from another documentBug
WORDSNET-14704Text in image is missing when exporting to HTMLBug
WORDSNET-14705More vertical spacing between lines added when exporting to HTMLBug
WORDSNET-14710Output Docx is not opened in MS Word after performing mail mergeBug
WORDSNET-14711Bookmark entries are not entirely merged after mail mergeBug
WORDSNET-14712Z-order is incorrect after conversion docx to odt.Bug
WORDSNET-14718Some table rows render on the previous page of PDFBug
WORDSNET-14767Bullet list is changed to numbered list after conversion from bytes to DocxBug
WORDSNET-14785ShapeAttr.LineFillBlipName attribute returns invalid valueBug
WORDSNET-14802A strange Box appears near certain images in PDFBug
WORDSNET-14832TTFontMetrics.BoldSimulationScale is not too accurate for MS GothicBug
WORDSNET-14839Hyperlink encoded twice in PDFBug
WORDSNET-14840Aspose.Words ignores stroke weight for autosized textboxesBug
WORDSNET-14855Shape with caps is not rendered correctlyBug
WORDSNET-14856Docx to Pdf conversion issue with StructuredDocumentTag renderingBug
WORDSNET-14864List label size differs in layout.Bug
WORDSNET-14870Content of StructuredDocumentTag is lost in output Pdf/DocBug
WORDSNET-14903Docx to Html conversion issue with chart’s axis boundsBug
WORDSNET-14905Ref field generates error code after conversion from FlatOpc to DocBug
WORDSNET-4803TOC update does not see format revision changes.Bug
WORDSNET-5542Position of AutoShape is changed after Appending.Bug
WORDSNET-5843Fonts substitution // Measurements: Spacing of text lines in PDF is different to when viewed in MS WordBug
WORDSNET-5956Fonts substitution // Incorrect fonts rendering.Bug
WORDSNET-8242Docx to HtmlFixed conversion issue with fontsBug
WORDSNET-8525/advanced typography/ Arabic text is incorrectly rendered to PDFBug
WORDSNET-8976WordArt // Multiline // Watermark shape is not rendering correctly in PDFBug
WORDSNET-9785Contents position is changed after conversion from Doc to PdfBug
WORDSNET-9949Table’s contents move to next page after conversion from Doc to PdfBug
WORDSNET-12581Table header should be pushed to the next page if no rows fit below header in 2013 modeEnhancement
WORDSNET-13472Table header row orphaned in 2013 modeEnhancement
WORDSNET-13729Mail Recipient is lost after re-saving DocEnhancement
WORDSNET-14608Add/remove document settings if OptimizeFor is called for a documentEnhancement
WORDSNET-14736Incorrect Asian font metricsEnhancement
WORDSNET-14759Saving resources when converting Words documents to HTMLEnhancement
WORDSNET-4316Fonts substitution // Improve font substitution rules.Enhancement
WORDSNET-13567Signing feature is not supported by ODT file formatException
WORDSNET-14690/space shrink/ System.NullReferenceException occurs during exporting Hyperlinks to HtmlFixedException
WORDSNET-14799Document.Save throws System.NullReferenceException while saving Docx to PdfException
WORDSNET-14859Documnte.RemoveUnusedResources throws System.ArgumentOutOfRangeExceptionException
WORDSNET-14895Aspose.Words.FileCorruptedException is thrown while loading DocException
WORDSNET-14896System.ArgumentOutOfRangeException is thrown while saving Doc to HtmlException
WORDSNET-12412Add MailMergeCleanupOptions option to remove empty rowFeature
WORDSNET-12487Cell’s content are warped incorrectly in output PdfFeature
WORDSNET-14389PDF output is incorrect for 2 text columnsFeature
WORDSNET-14489Add feature to set background color of table row using Linq Reporting EngineFeature
WORDSNET-14600Insert image dynamically using Linq without change size of textboxFeature
WORDSNET-14602Justification of OfficeMath objectFeature
WORDSNET-14611Obtain type of the MathObjectFeature
WORDSNET-14627Add feature to define variables in LINQ Reporting templateFeature
WORDSNET-14745Provide ability to specify locale at Field levelFeature
WORDSNET-14956Implement reading of themes for RTF format.Feature
WORDSNET-8969Support of MS Word 2013 documents (WORDSNET-7741 and WORDSNET-7964)Feature
WORDSNET-9943/table grid/ Cell’s content is rendering a few inches to the right in PDFFeature
WORDSNET-14454LeftIndent and FirstLineIndent are lost in output DocxRegression

Public API and Backward Incompatible Changes

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

WORDSNET-4316: Font Substitution Mechanism Improved

Previously Aspose.Words performed font substitution only in cases when FontInfo in the document for the missing font doesn’t contains the PANOSE. Now Aspose.Words evaluates all related fields in FontInfo (Panose, Sig etc) and finds the closest match among the available font sources. In case of font substitution the warning is issued with text:

“Font ‘<font_name>’ has not been found. Using ‘<substitution_name>’ font instead. Reason: closest match according to font info from the document.”

Please note that now font substitution mechanism will override the FontSettings.DefaultFontName in cases when FontInfo for the missing font is available in the document. FontSettings.DefaultFontName will be used only in cases when there are no FontInfo for the missing font.

Also please note that font substitution algorithm in MS Word is not documented. And the result of Aspose.Words font substitution may not match MS Word choice.

WORDSNET-14602 - New Public OfficeMath.MathObjectType Property Added

To improve customer experience with Office Math objects in Aspose.Words model we’ve exposed the following simple read-only addition to the public API:

  • New readon-only property OfficeMath.MathObjectType
  • New public enum MathObjectType
// How to use:
OfficeMath officeMath = GetOfficeMath();
if (officeMath.getMathObjectType() == MathObjectType.MATRIX)
{
   // Do something useful with the Matrix object.
}

Support of Variables, Dynamic Text Background Setting, and a New Image Size Fit mode Added to LINQ Reporting Engine

These issues have been resolved: WORDSNET-14489, WORDSNET-14600 and WORDSNET-14627

The following sections of the engine’s documentation were added/updated to describe the changes:

WORDSNET-12412 - Added a MailMergeCleanupOptions Option to Remove Empty Row

As per customer’s request, we have added a MailMergeCleanupOptions option allowing to remove empty rows during mail merge:

/// <summary>
/// Specifies whether empty rows that contain mail merge regions should be removed from the document.
/// </summary>
/// <remarks>
/// This option applies only to mail merge with regions.
/// </remarks>
RemoveEmptyTableRows = 0x20

Sample usage:

document.getMailMerge().setCleanupOptions(MailMergeCleanupOptions.REMOVE_EMPTY_TABLE_ROW | MailMergeCleanupOptions.REMOVE_CONTAINING_FIELDS);
document.getMailMerge().setMergeDuplicateRegions(true);
document.getMailMerge().executeWithRegions(dataTable);

WORDSNET-14602 - New Public Properties were Added to the OfficeMath Object.

New public properties Justification and DisplayType were added into the OfficeMath class.

/**
 Gets/sets Office Math justification.
 <p>Justification cannot be set to the Office Math with display format type <see cref="OfficeMathDisplayType.Inline"/>.</p>
 <p>Inline justification cannot be set to the Office Math with display format type <see cref="OfficeMathDisplayType.Display"/>.</p>
 <p>Corresponding <see cref="DisplayType"/> has to be set before setting Office Math justification.</p>
*/
public OfficeMathJustification Justification
/**
 Gets/sets Office Math display format type which represents whether an equation is displayed inline with the text&nbsp;
 or displayed on its own line.
 <p>Display format type has effect for top level Office Math only.</p>
 <p>Returned display format type is always <see cref="OfficeMathDisplayType.Inline"/> for nested Office Math.</p>
*/
public OfficeMathDisplayType DisplayType

Use Case:

OfficeMath officeMath = (OfficeMath)doc.getChild(NodeType.OFFICE_MATH, 0, true);

// Gets/sets Office Math display format type which represents whether an equation is displayed inline with the text

// or displayed on its own line.
officeMath.setDisplayType(OfficeMathDisplayType.DISPLAY);
 // or OfficeMathDisplayType.Inline

// Gets/sets Office Math justification.
officeMath.setJustification(OfficeMathJustification.LEFT);
 // Left justification of Math Paragraph.

Mimic MS Word VBA behavior:

  •  DisplayType cannot be changed for nested Office Math. The exception will be thrown.
  •   Inline justification cannot be set to the Office Math displayed on its own line (DisplayType=OfficeMathDisplayType.Display). The exception will be thrown. OfficeMath.DisplayType property has to be used to change OfficeMathDisplayType first.
  •   Justification cannot be set to the Office Math displayed inline with text. The exception will be thrown. OfficeMath.DisplayType property has to be used to change OfficeMathDisplayType first.

WORDSNET-14745 - Provided Ability to Specify Locale at Field Level

As per customer’s request, we have added a property that allows to get/set field’s locale:

/**
Gets or sets LCID of the field.
<seealso cref="FieldUpdateCultureSource.FieldCode"/>
*/
public int LocaleId

Sample usage:

DocumentBuilder builder = new DocumentBuilder();
Field field = builder.insertField("=1", null);
field.setLocaleId(1027);