Browse our Products

Aspose.Words for Java 19.7 Release Notes

Major Features

  • Cryptographic libraries are updated to eliminate known possible security vulnerabilities.
  • Aspose.Words.jdk16.jar compatibility with old Java 6,7 and 8 environments.
  • Implemented basic reader and writer for Markdown format.
  • Implemented public API for dealing with linked text boxes.
  • Implemented feature to detect SmartArt shape.
  • Added property Revision.Group.
  • Supported dynamic list numbering restart for LINQ Reporting Engine.
  • Released Advanced Typography package, kerning feature works now.
  • Improved handling of whitespace shrinking in a presence of an option “Balance SBCS characters and DBCS character”.
  • Improved handling of number separator in complex script languages.
  • Improved character spacing control handling where punctuation and kerning features come into play.
  • Improved handling of interscript spacing when it affects text shading area.
  • Improved row height calculation in specific scenarios where cell has vertical text direction.
  • Improved table breaking in specific cases where table contains floating objects
  • Fixed line overflow when tab character precedes large inline shape which does not fit into the container.
  • Implemented font fallback for WMF/EMF metafiles rendering.
  • Improved rendering of embedded objects thumbnails.
  • Improved rendering of stock charts with three series (high-low-close)
  • Improved rendering of charts with NaN values in the series.
  • Improved rendering of the plot area rectangle of DML chart, if a manual layout is specified.
  • Improved rendering of DML charts with scaled date axis.
  • Language settings in the format code are now taken into account when rendering DML charts.
  • Fixed a bug with rendering of the Pie chart with empty series.

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
WORDSJAVA-2113Update cryptographic libraries to eliminate known possible security vulnerabilities.New Feature
WORDSJAVA-2124Support Markdown format read/write.New Feature
WORDSNET-18418Add feature to create link with RevisionGroup and RevisionNew Feature
WORDSNET-16984Numbers in picture not visible in PDFNew Feature
WORDSNET-16572Special characters are converted as block in converted PDFNew Feature
WORDSNET-17234Add feature to restart the list number for each record of parent tableNew Feature
WORDSNET-11297Add feature to create linked textboxes programmaticallyNew Feature
WORDSNET-16412Chinese text of image is rendered as square boxes in output PDFNew Feature
WORDSNET-18745Add feature to detect SmartArt shapeNew Feature
WORDSJAVA-1101Using AW Javadoc in Eclipse does not work for some membersBug
WORDSJAVA-2087Document with embedded QuickTime MOV file throws ExceptionBug
WORDSJAVA-2097CurrentThreadSettings.setTimeZone does not set when used for LINQ ReportingBug
WORDSJAVA-2109Aspose.Words.jdk16.jar compatibility with old Java 6,7,8 environments.Bug
WORDSNET-17955Content control range is changed after DOCX->HTML->DOCX conversionBug
WORDSNET-18712Aspose.Words.FileCorruptedException occurs upon loading a DOCXBug
WORDSNET-18708System.IndexOutOfRangeException at tableStyle.ConditionalStyles.GetEnumerator()Bug
WORDSNET-18720Text characters are changed after conversion from DOC to DOCXBug
WORDSNET-18727Aspose.Words.FileCorruptedException is thrown while loading DOCBug
WORDSNET-18728Aspose.Words.FileCorruptedException is thrown while loading DOCBug
WORDSNET-18734Aspose.Words does not work under Xamarin.AndroidBug
WORDSNET-18729Document get corrupted after saving DOCX file with enable track changes and user commentsBug
WORDSNET-18738Highlighted color is lost for space character in output PDFBug
WORDSNET-18711Aspose.Words issue with multi-layer SVG imageBug
WORDSNET-17274Minus and Plus signs in embedded graph do not render in output PDFBug
WORDSNET-18611DOCX to PDF - text is moved to the page beforeBug
WORDSNET-15403Text position issue in rendered PDF documentBug
WORDSNET-18334The colon at the image top is not retained in PDFBug
WORDSNET-18428TIFF image is rendered as black box in output PDFBug
WORDSNET-18614System.ArgumentOutOfRangeException occurs upon saving to PDFBug
WORDSNET-17272Parentheses in embedded graph do not render in output PDFBug
WORDSNET-17380DOCX to PDF conversion issue with space character renderingBug
WORDSNET-17440Text in shapes turned into square boxes when rendered to PDFBug
WORDSNET-17513Parenthesis in X-Axis of chart rendered as Square Boxes in PDFBug
WORDSNET-17574DOCX to PDF conversion issue with text that contains tab and inline shapeBug
WORDSNET-17865DOCX to PDF conversion issue with chart renderingBug
WORDSNET-18089DOCX to PDF conversion issue with horizontal date axis of chartBug
WORDSNET-18045SVG image is not visible after DOCX to HtmlFixed conversionBug
WORDSNET-18331The last bracket of x-scale is missing in PDFBug
WORDSNET-17269Parentheses do not render in output PDFBug
WORDSNET-18533UpdateFields updates the format of paragraph end markBug
WORDSNET-17777Russian text is lost after conversion from DOC to DOCX/PDFBug
WORDSNET-18541Paragraphs are scrambled after conversion from Docx to RTFBug
WORDSNET-18544MailMerge.Execute generates incorrect output when mail merge fields are used with QUOTE and SET fieldsBug
WORDSNET-12163Contents move to next page after conversion from Docx to PdfBug
WORDSNET-18550Content pushed to the next pages in PDFBug
WORDSNET-18624The contents of the section footer is moved up to the right of the tableBug
WORDSNET-18450The CellFormat.HorizontalMerge returns incorrect valueBug
WORDSNET-18201DOCX to PDF conversion issue formula renderingBug
WORDSNET-18108Ink drawings not preserved during DOCX to DOC or RTF conversionBug
WORDSNET-18630System.ArgumentException is thrown while converting DOCX to PDFBug
WORDSNET-17596CellFormat.getVerticalMerge and getHorizontalMerge ignores cell property informationBug
WORDSNET-18394Picture moves towards the right page edge in HTMLBug
WORDSNET-18692The order of w:rubyPr tag is incorrect in output DOCXBug
WORDSNET-17230Kerning problem in DOC to PDF conversionBug
WORDSNET-18702Gradient color of shape is lost when DOT is converted to DOCX/DOTXBug
WORDSNET-18585Charts with #N/A in data are rendered incorrectly when converting to PDFBug
WORDSNET-18769Unable to cast object of type ‘Aspose.Words.Style’ to type ‘Aspose.Words.TableStyle’Bug
WORDSNET-17488Content position is changed after conversion from DOCX to PDFBug
WORDSNET-18043System.NullReferenceException is thrown while saving DOCX to PDFBug
WORDSNET-18133Document.UpdateFields changes the text alignment of table’s cellBug
WORDSNET-18102DOCX to PDF conversion issue with chart’s renderingBug
WORDSNET-17199Contents shifted up in Aspose.Words PDF outputBug
WORDSNET-18379DOCX to HTML performance regression between 19.1 and 19.2Bug
WORDSNET-18755Word 2003 XML document corrupts after loading with Aspose.WordsBug
WORDSNET-18649Horizontal Axis of chart does not render correctlyBug
WORDSNET-18731DOCX to HtmlFixed conversion issue with inline content controlBug
WORDSNET-18181Image quality of OLE icon is lost after conversion from RTF to HTMLBug
WORDSNET-18765’too many styles in the document’ exception upon loading a RTFBug
WORDSNET-18675Aspose removing foreign characters on converting to PDFBug
WORDSNET-18676System.IndexOutOfRangeException occurs upon UpdatePageLayoutBug
WORDSNET-18684Failed few test from TestLineCaps classBug
WORDSNET-18685Format of axis labels is incorrect after converting to PDFBug
WORDSNET-18741ReportingEngine.BuildReport throws NullPointerException when table has merged cellBug
WORDSNET-18695Incorrect position of CommentRangeBug
WORDSNET-18749Check suspicious code found by PVS studioBug
WORDSNET-18777TrackChanges stop working for Replace in 19.6Bug
WORDSNET-18748Check suspicious code found by PVS studioBug
WORDSNET-16214SVG image is filled incorrectly after importBug
WORDSNET-17977DOCX to PDF conversion issue with chart’s X-AxisBug
WORDSNET-17138Comma separated number changed when DOCX is converted to PDFBug
WORDSNET-17378Text of Image is not rendered in output PDFBug
WORDSNET-17516Star symbols in chart rendered as Square Boxes in PDFBug
WORDSNET-17514Triangle delta symbols in Y-Axis of chart rendered as Square Boxes in PDFBug
WORDSNET-15794Hebrew text is reversed when RTF is converted to PDFBug
WORDSNET-14866Text is divided on columns after converting by Aspose from DOCX to FixedHTMLBug
WORDSNET-12847Cell’s contents are render in two lines in output PDFBug
WORDSNET-12705VML shape in improperly converted from DOCX to PDFBug
WORDSNET-13327Horizontally merged cells are ignored in PDF after calling Document.UpdateTableLayoutBug

Public API and Backward Incompatible Changes

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

Added property Revision.Group

Related issue: WORDSNET-18418

Added the following new property to the Revision class:

/// <summary>
/// Gets the revision group. Returns null if the revision does not belong to any group.
/// </summary>
/// <remarks>
/// Revision has no group if revision type is RevisionType.StyleDefinitionChange or
/// if the revision is not longer exist in document context (accepted/rejected).
/// </remarks>
public RevisionGroup Group

Use Case:

Document doc = new Document(@"source.docx");
foreach (Revision revision in doc.Revisions)
{
    string groupText = revision.Group != null
        ? "Revision group text: " + revision.Group.Text
        : "Revision has no group";
    Console.WriteLine("Type: " + revision.RevisionType);
    Console.WriteLine("Author: " + revision.Author);
    Console.WriteLine("Date: " + revision.DateTime);
    Console.WriteLine("Revision text: " + revision.ParentNode.ToString(SaveFormat.Text));
    Console.WriteLine(groupText);
}

Implemented basic reader and writer for Markdown features

Related issue: WORDSNET-18338.

For a moment the following Markdown features are supported:

  • Headings
  • Block quotes
  • Horizontal rules
  • Bold emphasis
  • Italic emphasis

The new public enumerations were added:

LoadFormat.Markdown
SaveFormat.Markdown
FileFormat.Markdown

The new TxtSaveOptionsBase class was added:

/// <summary>
/// The base class for specifying additional options when saving a document into a text based formats.
/// </summary>
public abstract class TxtSaveOptionsBase : SaveOptions

Some of the members were moved from the TxtSaveOptions class into TxtSaveOptionsBase class:

/// <summary>
/// Specifies the encoding to use when exporting in text formats. 
/// Default value is <ms><b>Encoding.UTF8</b></ms><java>'UTF-8' Charset</java>.
/// </summary>
public Encoding Encoding
/// <summary>
/// Specifies the string to use as a paragraph break when exporting in text formats.
/// </summary>
/// <remarks>
/// <p>The default value is <see cref="ControlChar.CrLf"/>.</p>
/// </remarks>
public string ParagraphBreak
/// <summary>
/// Specifies whether the program should attempt to preserve layout of tables when saving in the plain text format.
/// The default value is <b>false</b>.
/// </summary>
public bool PreserveTableLayout
/// <summary>
/// <para>Allows to specify whether the page breaks should be preserved during export.</para>
/// <para>The default value is <b>false</b>.</para>
/// </summary>
/// <remarks>
/// The property affects only page breaks that are inserted explicitly into a document. 
/// It is not related to page breaks that MS Word automatically inserts at the end of each page.
/// </remarks>
public bool ForcePageBreaks
/// <summary>
/// Specifies the way headers and footers are exported to the text formats.
/// Default value is <see cref="TxtExportHeadersFootersMode.PrimaryOnly"/>.
/// </summary>
public TxtExportHeadersFootersMode ExportHeadersFootersMode

Our implementation is mostly follows the CommonMark specification. In AW model Markdown features are represented as corresponding styles or direct formatting. So, bold and italic are represented as Font.Bold and Font.Italic. Headings are paragraphs with Heading 1 - Heading 6 styles. Quotes are paragraphs with “Quote” in style name. HorizontalRule is a paragraph with HorizontalRule shape.

Use Case 1. Explains how to produce the following Markdown document with emphases:

Markdown treats asterisks (*) and underscores (_) as indicators of emphasis.
You can write **bold** or *italic* text. 
You can also write ***BoldItalic***text.
DocumentBuilder builder = new DocumentBuilder(new Document());
builder.Writeln("Markdown treats asterisks (*) and underscores (_) as indicators of emphasis.");
builder.Write("You can write ");
builder.Font.Bold = true;
builder.Write("bold");
builder.Font.Bold = false;
builder.Write(" or ");
builder.Font.Italic = true;
builder.Write("italic");
builder.Font.Italic = false;
builder.Writeln(" text. ");
builder.Write("You can also write ");
builder.Font.Bold = true;
builder.Font.Italic = true;
builder.Write("BoldItalic");
builder.Font.Bold = false;
builder.Font.Italic = false;
builder.Write("text.");
builder.Document.Save("EmphasesExample.md");

Use Case 2. Explains how to produce the following Markdown document with Headings:

The following produces headings:
\# Heading1
\## Heading2
\### Heading3
\#### Heading4
\##### Heading5
\###### Heading6
\# **Bold Heading1**
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// By default Heading styles in Word may have bold and italic formatting.

// If we do not want text to be emphasized, set these properties explicitly to false.
builder.Font.Bold = false;
builder.Font.Italic = false;
builder.Writeln("The following produces headings:");
builder.ParagraphFormat.Style = doc.Styles["Heading 1"];
builder.Writeln("Heading1");
builder.ParagraphFormat.Style = doc.Styles["Heading 2"];
builder.Writeln("Heading2");
builder.ParagraphFormat.Style = doc.Styles["Heading 3"];
builder.Writeln("Heading3");
builder.ParagraphFormat.Style = doc.Styles["Heading 4"];
builder.Writeln("Heading4");
builder.ParagraphFormat.Style = doc.Styles["Heading 5"];
builder.Writeln("Heading5");
builder.ParagraphFormat.Style = doc.Styles["Heading 6"];
builder.Writeln("Heading6");

// Note, emphases are also allowed inside Headings:
builder.Font.Bold = true;
builder.ParagraphFormat.Style = doc.Styles["Heading 1"];
builder.Writeln("Bold Heading1");
doc.Save("HeadingsExample.md");

Use Case 3. Explains how to produce the following Markdown document with block quotes:

We support blockquotes in Markdown:
\>*Lorem*
\>*ipsum*
The quotes can be of any level and can be nested:
\>>>Quote level 3
\>>>>Nested quote level 4
\>
\>*Back to first level*
\> ### Headings are allowed inside Quotes
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Writeln("We support blockquotes in Markdown:");
builder.ParagraphFormat.Style = doc.Styles["Quote"];
builder.Writeln("Lorem");
builder.Writeln("ipsum");
builder.ParagraphFormat.Style = doc.Styles["Normal"];
builder.Writeln("The quotes can be of any level and can be nested:");
Style quoteLevel3 = doc.Styles.Add(StyleType.Paragraph, "Quote2");
builder.ParagraphFormat.Style = quoteLevel3;
builder.Writeln("Quote level 3");
Style quoteLevel4 = doc.Styles.Add(StyleType.Paragraph, "Quote3");
builder.ParagraphFormat.Style = quoteLevel4;
builder.Writeln("Nested quote level 4");
builder.ParagraphFormat.Style = doc.Styles["Quote"];
builder.Writeln();
builder.Writeln("Back to first level");
Style quoteLevel1WithHeading = doc.Styles.Add(StyleType.Paragraph, "Quote Heading 3");
builder.ParagraphFormat.Style = quoteLevel1WithHeading;
builder.Write("Headings are allowed inside Quotes");
doc.Save("QuotesExample.md");

Use Case 4. Explains how to produce the following Markdown document with Horizontal Rule:

We support Horizontal rules (Thematic breaks) in Markdown:
\-----
DocumentBuilder builder = new DocumentBuilder(new Document());
builder.Writeln("We support Horizontal rules (Thematic breaks) in Markdown:");
builder.InsertHorizontalRule();
builder.Document.Save("HorizontalRuleExample.md");

Use Case 5. Explains how to read Markdown document.

// This is Markdown document that was produced in example of UC3.
Document doc = new Document("QuotesExample.md");

// Let's remove Heading formatting from a Quote in the very last paragraph.
Paragraph paragraph = doc.FirstSection.Body.LastParagraph;
paragraph.ParagraphFormat.Style = doc.Styles["Quote"];
doc.Save("QuotesModifiedExample.md");

Implemented feature to detect SmartArt shape

Related issue: WORDSNET-18745.

Added the following new property to a Shape class:

/// <summary>
/// Returns true if this Shape has a SmartArt object.
/// </summary>
public bool HasSmartArt

Use Case: Count a number of shapes with SmartArt in a document.

Document doc = new Document(@"input.docx");
int count = 0;
foreach (Shape shape in doc.GetChildNodes(NodeType.Shape, true))
{
    if (shape.HasSmartArt)
        count++;
}
Console.WriteLine("The document has {0} shapes with SmartArt.", count);

Supported dynamic list numbering restart for LINQ Reporting Engine

Issue: WORDSNET-17234

The “Restarting List Numbering Dynamically” section of the engine’s documentation was added to describe the change.

WORDSNET-11297 - Implemented public API for dealing with linked textboxes

New public properties and methods were added into the TextBox class.

A public property for getting parent shape from text box was added to allow customer to find linked Shape from linked TextBox.

/// <summary>
/// Determines whether this TextBox can be linked to the target Textbox.
/// </summary>
public bool IsValidLinkTarget(TextBox target)
{
}
/// <summary>
/// Returns or sets a TextBox that represents the next TextBox in a sequence of shapes.
/// </summary>
public TextBox Next
{
  get; set;
}
/// <summary>
/// Returns a TextBox that represents the previous TextBox in a sequence of shapes.
/// </summary>
public TextBox Previous
{
  get;
}
/// <summary>
/// Breaks the forward link for the specified TextBox, if such a link exists.
/// </summary>
/// <remarks>
/// BreakForwardLink() doesn't break all other links in the current sequence of shapes.
/// For example: 1-2-3-4 sequence and BreakForwardLink at the 2-nd textbox will create
/// two sequences 1-2, 3-4.
/// </remarks>
public void BreakForwardLink()
{
}
/// <summary>
/// Gets a parent shape for the TextBox.
/// </summary>
public Shape Parent
{
    get { return mParent; }
}

Use Case to create a link from shape1.TextBox to shape2.TextBox:

TextBox textBox1 = shape1.TextBox;
TextBox textBox2 = shape2.TextBox;
if (textBox1.IsValidLinkTarget(textBox2))
  textBox1.Next = textBox2;

Use Case to check if shape.TextBox is a Head, a Tail or a Middle of the sequence:

TextBox textBox = shape.TextBox;
if ((textBox.Next != null) && (textBox.Previous == null))
{
  //The head of the sequence.
}
if ((textBox.Next != null) && (textBox.Previous != null))
{
  //The Middle of the sequence.
}
if ((textBox.Next == null) && (textBox.Previous != null))
{
  //The Tail of the sequence.
}

Use Case to break a link for a shape.TextBox:

TextBox textBox = shape.TextBox;

// Break a forward link
textBox.BreakForwardLink();

// Break a forward link by setting a null
textBox.Next = null;

// Break a link, which leads to this textbox
if (textBox.Previous != null)
  textBox.Previous.BreakForwardLink();