Aspose.Words for Java 21.5 Release Notes

Major Features

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

  • EQ field export to all HTML based formats was implemented.
  • Added new methods to set checked and unchecked symbol for StructuredDocumentTag.
  • Implemented an ability to use PDF annotations to display user comments.
  • Added MailMerge.RestartListsAtEachSection property to control list numbering restart.
  • Provided a way to customize restrictions on dynamic cell merging for LINQ Reporting Engine.

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
WORDSJAVA-1983Documentation for Java Media Framework on JDK11New Feature
WORDSNET-15678Export vector images to SVG when saving a document to HTMLNew Feature
WORDSNET-21823LINQ Reporting Engine - Provide a way to customize restrictions on dynamic cell mergingNew Feature
WORDSNET-21645Add comments of Word document as annotation in PDFNew Feature
WORDSNET-21949Support StylisticSet attribute in the document modelNew Feature
WORDSNET-21818Add feature to set content control (checkbox) checked/unchecked symbolNew Feature
WORDSNET-22032Heading List Number restarts after Section Break when mail merge is performedNew Feature
WORDSNET-17792EQ field is not exported in output HTMLNew Feature
WORDSNET-9121Write generator name (Aspose.Words x.x.x.x) in HtmlFixed formatEnhancement
WORDSNET-6284Extend Structured Document Tag APIEnhancement
WORDSNET-10021Give a valid GUID to custom xml partsEnhancement
WORDSNET-11931Add feature to detect either shape node is ActiveX or notEnhancement
WORDSNET-21596Support of decorative shapes for document accessibilityEnhancement
WORDSNET-21908Implement ClearQuickStyleGallery() method for DOC/RTF formatEnhancement
WORDSNET-9400Add feature to get styles in a document which are not currently usedEnhancement
WORDSNET-21787DOCX to PDF conversion issue with text wrapping in table cellEnhancement
WORDSJAVA-2462DOCX to PDF conversion: “java.lang.NullPointerException”Bug
WORDSJAVA-2529GetText() difference in lists examples between .NET and JavaBug
WORDSJAVA-2538java.lang.UnsatisfiedLinkError is thrown while saving DOCX to PDF at UbuntuBug
WORDSNET-7198Image in ODT is getting truncated at the bottom of Page in PDFBug
WORDSNET-10203Style is changed after conversion from WordML to DocBug
WORDSNET-13076Mongolian text is rendered as boxes in output PDFBug
WORDSNET-22027System.InvalidOperationException occurs upon updating fieldsBug
WORDSNET-22028Performance tests fail on some Intel i7 and i9 CPUBug
WORDSNET-22029TestBenchmark.PeakMemoryMeter fails for x86 buildsBug
WORDSNET-20197The ShapeType from the DmlShape class does not identify all shapesBug
WORDSNET-22031Content Control (dropdown) value is changed after re-saving DOCXBug
WORDSNET-21515Arabic Text - Applying TextShaperFactory produces garbage square boxes in PDFBug
WORDSNET-21391Japanese text is rotated after DOCX to PDF conversionBug
WORDSNET-21517A Textbox goes behind the background image during processing an ODTBug
WORDSNET-12609DOCX to PDF conversion issue with Arabic TextBug
WORDSNET-12920Saving to DOCX encodes with UTF-8+BOM instead of charset UTF-8Bug
WORDSNET-20774Performance degrades as we increase number of threadsBug
WORDSNET-18929TxtSaveOptions converts single quote incorrectlyBug
WORDSNET-20217Chart axis tickmarks rendered incorrectly in output PDFBug
WORDSNET-16109Khmer font rendering issue in PDFBug
WORDSNET-16333The EQ field is not exported in output HTMLBug
WORDSNET-17012Equations (EQ fields) not preserved in generated HTML/PDFBug
WORDSNET-22179Range.Replace hangsBug
WORDSNET-22165GetShapeRenderer throws exception when converting SmartArt objects in parallelBug
WORDSNET-22135Line break is removed from Variable valueBug
WORDSNET-17451Table borders got missed when comparing documentsBug
WORDSNET-17469Repeated values in Y-Axis chart appear when renderedBug
WORDSNET-11335DOC to PDF conversion issue with Gujarati text renderingBug
WORDSNET-21803Aspose.Words.FileCorruptedException is thrown while importing HTMLBug
WORDSNET-21673DOC to HTML conversion issue with Formula fieldBug
WORDSNET-21675DOCX to HTML conversion issue with Formula fieldBug
WORDSNET-2492Restricted styles are accessible after open/save the documentBug
WORDSNET-18819Issue when converting doc with image and shapes to HTMLBug
WORDSNET-19191X-Axis chart values missing in PDFBug
WORDSNET-22047Words with noProof in some spans are not hyphenated correctlyBug
WORDSNET-19442X-Axis value and a Line in Chart missing when rendering to JPGBug
WORDSNET-22063Performance issue upon saveBug
WORDSNET-21762GetStartPageIndex and GetEndPageIndex returns incorrect page numberBug
WORDSNET-22035Document.Compare does not mimic MS Word behaviorBug
WORDSNET-22066HiddenAttributeCache takes too much memoryBug
WORDSNET-4756Cannot use Save_4 overload in vbscriptBug
WORDSNET-21857INCLUDEPICTURE does not render the image in output DOC and PDFBug
WORDSNET-22075Embedded PPT is converted to image after updateBug
WORDSNET-21721RevisionOptions.ShowRevisionMarks causes InvalidCastExceptionBug
WORDSNET-22068DOCX to PDF numbers in table pushed to the sideBug
WORDSNET-22081Horizontal Solid Lines become Dotted in PDFBug
WORDSNET-21586Arabic Text - Applying TextShaperFactory produces garbage square boxes in PDFBug
WORDSNET-21727Bullet lists are not processed properly when saving document in the Markdown formatBug
WORDSNET-22084Investigate failed customer testBug
WORDSNET-21461Spacing between Laotian Words and Lines increased in PDF - Font: DokChampa & MingLiUBug
WORDSNET-21724Footnote number is inserted at the end of Paragraph using Range.RepalceBug
WORDSNET-21709ArgumentNullException when call document.ExtractPagesBug
WORDSNET-22046Lines with words traversing field boundaries are not hyphenated correctlyBug
WORDSNET-21612Hyperlinks are not Clickable when passed as Hidden into generated Word DocumentBug
WORDSNET-22073Long conversion time to HTML for certain DOC fileBug
WORDSNET-22087Range.Fields throws System.InvalidOperationExceptionBug
WORDSNET-21629DOCX to HTML conversion issue with spaces between text (tabs)Bug
WORDSNET-21757Importing content from XML files to the DOCX: New style introduced in the output Bug
WORDSNET-21633DOCX-HTML-DOCX conversion issue with image positionBug
WORDSNET-21923Three rendering tests fail in parallel modeBug
WORDSNET-22091Resaving DOCX file corrupts table in output fileBug
WORDSNET-22092FileCorruptedException is thrown while importing DOC fileBug
WORDSNET-22039Legend of chart is displayed in output PDF when Legend.Position is set to NoneBug
WORDSNET-21934Color issue while converting docx to pdf in aspose.words javaBug
WORDSNET-22097Table.ConvertToHorizontallyMergedCells throws IndexOutOfRangeException for table created with DocumentBuilderBug
WORDSNET-22098Nested EQ fields are not properly renderedBug
WORDSNET-21942Document.UpdateFields throws System.ArgumentOutOfRangeExceptionBug
WORDSNET-14585Problems with MS-Word CompatibilityBug
WORDSNET-21728Vector Arrows in Latex Math Equations got Corrupted (Question Marks) during Open/Save a DOCXBug
WORDSNET-21945DOCX to PDF Basque language word converted to EnglishBug
WORDSNET-21794System.Xml.XmlException is thrown by InsertHtmlBug
WORDSNET-22105Output file is corrupted after appending contentBug
WORDSNET-22038Data Label of chart does not display in output PDFBug
WORDSNET-21984Saving invalid word document file cause hanging programBug
WORDSNET-22115Aspose.Words.FileCorruptedException is thrown while loading DOCXBug
WORDSNET-22114Field value is changed in output PDFBug
WORDSNET-22112GetStartPageIndex throws System.ArgumentNullExceptionBug
WORDSNET-21992X axis of Chart is lost after DOCX to PDF conversionBug
WORDSNET-18461DOCX to PDF conversion issue with hindi textBug
WORDSNET-21996Analyze thread locks used in codeBug
WORDSNET-22119Certain RTF to HTML hangs processBug
WORDSNET-22110RemoveContainingFields breaks SEQ functionalityBug
WORDSNET-22000DOCX to HTML: Adobe fonts displayed differently than with MS WordBug
WORDSNET-22130Document.AcceptAllRevisions method does not work as expectedBug
WORDSNET-21671Backward HTML converter does not process external styles like inlineBug
WORDSNET-21745DOCX to PDF conversion issue with ExportDocumentStructure (incorrect table tags)Bug
WORDSNET-22017Page number using LayoutCollector.GetStartPageIndex raising exceptionBug
WORDSNET-21521PDF/A-1a fails accessibility check with textboxBug
WORDSNET-4585SYMBOL field is not properly rendered.Bug
WORDSNET-14734Incorrect Bold Run attribute after GetExpandedRunPr()Bug
WORDSNET-14372An extra list item appears in a document imported from HTMLBug
WORDSNET-20911Word2013 and Word2019 shows document differentlyBug
WORDSNET-3389Range comment around a shape not preserved during open/saveBug
WORDSNET-19407List item’s indent is incorrect after roundtrip DOCX-HTML-DOCXBug
WORDSNET-6412NodeCopier does not handle section break correctlyBug
WORDSNET-8987Incorrect position of a shape with pushed anchorBug

Public API and Backward Incompatible Changes

This section lists public API changes that were introduced in Aspose.Words 21.5. 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 value to public enumeration StyleIdentifier

Related issue: WORDSNET-21757

A new value is added to the public enumeration StyleIdentifier:

/// <summary>
/// The Smart Link style.
/// </summary>
SmartLink = 371

Related issue: WORDSNET-22032

We have implemented the MailMerge.RestartListsAtEachSection property to control whether or not list numbering is restarted at each section when mail merge is performed. It is true by default to mimic Word behaviour, but can be set to false if the customer wants continuous numbering.

/// <summary>
/// Gets or sets a value indicating whether lists are restarted at each section after executing of a mail merge.
/// </summary>
/// <remarks>
/// The default value is <b>true</b>.
/// </remarks>
public bool RestartListsAtEachSection { get; set; }

Use Case:

Document document = new Document();
document.Lists.Add(ListTemplate.NumberDefault);
document.Lists.Add(ListTemplate.OutlineNumbers);
document.Lists.Add(ListTemplate.BulletDefault);
 
document.MailMerge.RestartListsAtEachSection = false;
document.MailMerge.Execute(new string[0], new object[0]);

Added new members to ShapeType enum

Related issue: WORDSNET-20197

The following new members have been added to the ShapeType enum. The members are applicable only for DML shapes.

public enum ShapeType
{
    ...
    /// <summary>
    /// Heptagon.
    /// </summary>
    Heptagon = 210,
    /// <summary>
    /// Cloud.
    /// </summary>
    Cloud = 211,
    /// <summary>
    /// Six-pointed star.
    /// </summary>
    Seal6 = 212,
    /// <summary>
    /// Seven-pointed star.
    /// </summary>
    Seal7 = 213,
    /// <summary>
    /// Ten-pointed star.
    /// </summary>
    Seal10 = 214,
    /// <summary>
    /// Twelve-pointed star.
    /// </summary>
    Seal12 = 215,
    /// <summary>
    /// Swoosh arrow.
    /// </summary>
    SwooshArrow = 216,
    /// <summary>
    /// Teardrop.
    /// </summary>
    Teardrop = 217,
    /// <summary>
    /// Square tabs.
    /// </summary>
    SquareTabs = 218,
    /// <summary>
    /// Plaque tabs.
    /// </summary>
    PlaqueTabs = 219,
    /// <summary>
    /// Pie.
    /// </summary>
    Pie = 220,
    /// <summary>
    /// Wedge pie.
    /// </summary>
    WedgePie = 221,
    /// <summary>
    /// Inverse line.
    /// </summary>
    InverseLine = 222,
    /// <summary>
    /// Math plus.
    /// </summary>
    MathPlus = 223,
    /// <summary>
    /// Math minus.
    /// </summary>
    MathMinus = 224,
    /// <summary>
    /// Math multiply.
    /// </summary>
    MathMultiply = 225,
    /// <summary>
    /// Math divide.
    /// </summary>
    MathDivide = 226,
    /// <summary>
    /// Math equal.
    /// </summary>
    MathEqual = 227,
    /// <summary>
    /// Math not equal.
    /// </summary>
    MathNotEqual = 228,
    /// <summary>
    /// Non-isosceles trapezoid.
    /// </summary>
    NonIsoscelesTrapezoid = 229,
    /// <summary>
    /// Left-right circular arrow.
    /// </summary>
    LeftRightCircularArrow = 230,
    /// <summary>
    /// Left-right ribbon.
    /// </summary>
    LeftRightRibbon = 231,
    /// <summary>
    /// Left circular arrow.
    /// </summary>
    LeftCircularArrow = 232,
    /// <summary>
    /// Frame.
    /// </summary>
    Frame = 233,
    /// <summary>
    /// Half frame.
    /// </summary>
    HalfFrame = 234,
    /// <summary>
    /// Funnel.
    /// </summary>
    Funnel = 235,
    /// <summary>
    /// Six-tooth gear.
    /// </summary>
    Gear6 = 236,
    /// <summary>
    /// Nine-tooth gear.
    /// </summary>
    Gear9 = 237,
    /// <summary>
    /// Decagon.
    /// </summary>
    Decagon = 238,
    /// <summary>
    /// Dodecagon.
    /// </summary>
    Dodecagon = 239,
    /// <summary>
    /// Diagonal stripe.
    /// </summary>
    DiagonalStripe = 240,
    /// <summary>
    /// Corner.
    /// </summary>
    Corner = 241,
    /// <summary>
    /// Corner tabs.
    /// </summary>
    CornerTabs = 242,
    /// <summary>
    /// Chord.
    /// </summary>
    Chord = 243,
    /// <summary>
    /// Chart plus.
    /// </summary>
    ChartPlus = 244,
    /// <summary>
    /// Chart star.
    /// </summary>
    ChartStar = 245,
    /// <summary>
    /// Chart X.
    /// </summary>
    ChartX = 246
}

Added new public methods StructuredDocumentTag.SetCheckedSymbol() and StructuredDocumentTag.SetUncheckedSymbol()

Related issue: WORDSNET-21818

New public methods SetCheckedSymbol() and SetUncheckedSymbol() have been added to the StructuredDocumentTag class:

/// <summary>
/// Sets the symbol used to represent the checked state of a check box content control.
/// </summary>
/// <param name="characterCode">The character code for the specified symbol.</param>
/// <param name="fontName">The name of the font that contains the symbol.</param>
/// <remarks>
/// <para>Accessing this method will only work for <see cref="Markup.SdtType.Checkbox"/> SDT types.</para>
/// <para>For all other SDT types exception will occur.</para>
/// </remarks>
public void SetCheckedSymbol(int characterCode, string fontName);
/// <summary>
/// Sets the symbol used to represent the unchecked state of a check box content control.
/// </summary>
/// <param name="characterCode">The character code for the specified symbol.</param>
/// <param name="fontName">The name of the font that contains the symbol.</param>
/// <remarks>
/// <para>Accessing this method will only work for <see cref="Markup.SdtType.Checkbox"/> SDT types.</para>
/// <para>For all other SDT types exception will occur.</para>
/// </remarks>
public void SetUncheckedSymbol(int characterCode, string fontName);

Use Case: Explains how to set the checked and unchecked symbols for the SDT of the ‘SdtType.Checkbox’ type.

Document doc = new Document();
StructuredDocumentTag tag = new StructuredDocumentTag(doc, SdtType.Checkbox, MarkupLevel.Block);
doc.Sections[0].Body.AppendChild(tag);
tag.SetCheckedSymbol(0x00A9, "Times New Roman");
tag.SetUncheckedSymbol(0x00AE, "Times New Roman");
doc.Save("output.docx");

Added new public property Document.LayoutOptions.CommentDisplayMode

Related issue: WORDSNET-21645

Added the ability to use PDF annotations to display user comments. The comment display mode is now set via the Document.LayoutOptions.CommentDisplayMode property:

/// <summary>
/// Gets or sets the way comments are rendered.
/// Default value is <see cref="CommentDisplayMode.ShowInBalloons"/>.
/// </summary>
/// <remarks>
/// Note that revisions are not rendered in balloons for <see cref="CommentDisplayMode .ShowInAnnotations"/>.
/// </remarks>
public CommentDisplayMode CommentDisplayMode

Document.LayoutOptions.ShowComments property was marked as obsolete:

/// <summary>
/// Gets or sets indication of whether comments are rendered.
/// Default is True.
/// This property is obsolete. Use <see cref="LayoutOptions.CommentDisplayMode"/> property instead.
/// </summary>
[Obsolete("This property is obsolete. Use CommentDisplayMode property instead.")]
public bool ShowComments
 
// False == CommentDisplayMode.Hide
// True == CommentDisplayMode.ShowInBalloons

The following comment display modes are now available:

/// <summary>
/// Specifies the rendering mode for document comments.
/// </summary>
public enum CommentDisplayMode
{
    /// <summary>
    /// No document comments are rendered.
    /// </summary>
    Hide,
    /// <summary>
    /// Renders document comments in balloons in the margin. This is the default value.
    /// </summary>
    ShowInBalloons,
    /// <summary>
    /// Renders document comments in annotations. This is only available for Pdf format.
    /// </summary>
    ShowInAnnotations
}

CommentDisplayMode.ShowInAnnotations is only available in Pdf1.7 and Pdf1.5 for user comments (revisions are not supported). In other formats ShowInAnnotations will work similar to Hide.

Note: It is required to rebuild the document page layout (via Document.UpdatePageLayout() method) after changing the Document.LayoutOptions values.

Use Case: Explains how to set CommentDisplayMode.

Document doc = new Document("input.docx");
doc.LayoutOptions.CommentDisplayMode = CommentDisplayMode.ShowInAnnotations;
doc.Save("output.pdf");

Use Case:

Document doc = new Document("input.docx");
doc.LayoutOptions.CommentDisplayMode = CommentDisplayMode.ShowInAnnotations;
doc.Save("output-pdf.pdf"); // This is a new way to display comments available for Pdf(not supported for Pdf/A).
doc.Save("output-xps.xps"); // When saving to any other format, it works in the same way as CommentDisplayMode.Hide.
 
doc.LayoutOptions.CommentDisplayMode = CommentDisplayMode.Hide;
doc.UpdatePageLayout();
doc.Save("output-hide.pdf"); //This is similar to the obsolete option ShowComments=false
 
doc.LayoutOptions.CommentDisplayMode = CommentDisplayMode.ShowInBalloons;
doc.UpdatePageLayout();
doc.Save("output-balloon.pdf"); //This is similar to the obsolete option ShowComments=true

Provided a way to customize restrictions on dynamic cell merging for LINQ Reporting Engine

Related issue: WORDSNET-21823

The “Merging Table Cells Dynamically” section of the engine’s documentation was updated to describe the change.