Aspose.Words for Python via .NET 21.11 Release Notes

Major Features

There are 64 improvements and fixes in this release. The most notable are:

  • New UseAttachments option has been implemented to display the attachments panel in the output PDF documents.
  • Added a new ChmLoadOptions to get more control over CHM loading.
  • Added new option to ignore field codes during find-replace operation.
  • Added ability to save images as Base64 string to Markdown format.

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

WORDSNET-1697Add possibility to use complex Fill Effects for shapes (gradient, texture etc)New Feature
WORDSNET-8696Add new property of PdfSaveOptions to export SDT controls as editable PDF form fieldsNew Feature
WORDSNET-9945Support native gradients with transparency in PDFNew Feature
WORDSNET-11453Add feature to view/hide navigation panes of PDFNew Feature
WORDSNET-14472Consider adding a Callback event that notifies the progress of loading documentNew Feature
WORDSNET-14510SDT controls are not editable in the produced PDFNew Feature
WORDSNET-14850Export drop-down list content controls as ‘select’ HTML elementsNew Feature
WORDSNET-17181Block level SDT not converting to Editable AcroFrom fieldNew Feature
WORDSNET-18648Text gradient supportNew Feature
WORDSNET-22513Support “ms-its” and other local URLs during import CHM from a streamNew Feature
WORDSNET-22787Introduce ExportImagesAsBase64 option for MD formatNew Feature
WORDSNET-22794Implement MS Word scaling algorithm for non-native Ink objects when renderingNew Feature
WORDSNET-22803Provide full support of ReportingEngine.UseReflectionOptimization for .NET StandardNew Feature
WORDSNET-22897Check Aspose.Words for .NET Standard works with .NET 6.0New Feature
WORDSNET-8920SDT controls placed outside paragraph level are not preserved when converting to PDFEnhancement
WORDSNET-11542Provide ExportDropDownFormFieldAsText property for StructuredDocumentTagEnhancement
WORDSNET-14318Provide option to export SDT checkboxes as <input> in HTMLEnhancement
WORDSNET-16057PDF with gradient fill print Issue with ChromeEnhancement
WORDSNET-21698Convert Word Content Controls to Editable Controls in PDFEnhancement
WORDSNET-9273Conversion of DOCX to DOC and PDF file format change the NUMPAGES valueBug
WORDSNET-17043PDF generated by Aspose.Words is blank when it is printed by Acrobat Reader DCBug
WORDSNET-17045PDF with gradient fill print Issue with ChromeBug
WORDSNET-18805Incorrect scaling of the secondary vertical axis after converting to PDFBug
WORDSNET-19157Arrows in OfficeMath equation are rendered incorrectly in output EMFBug
WORDSNET-19158OfficeMath renders incorrectly in output EMFBug
WORDSNET-19731Incorrect calculation of the X-axis maximum when converting chart to PDFBug
WORDSNET-20917Page numbering incorrect when Cover page present in documentBug
WORDSNET-21782Bottom and Right border is lost after converting Shape to ImageBug
WORDSNET-22133Incorrect version of harfbuzz.dll is selected when running app with .NET CLIBug
WORDSNET-22348Extra text is exported after DOCX to HTML conversionBug
WORDSNET-22367Latent Style Information Lost during re-SavingBug
WORDSNET-22457Arabic words not rendering as expectedBug
WORDSNET-22517NullReferenceException when exporting to HTMLBug
WORDSNET-22540Data labels in the chart messed up when converting to PDFBug
WORDSNET-22633HTML is loaded as plain textBug
WORDSNET-22683‘Culture not supported’ exception is thrown while saving document to PDFBug
WORDSNET-22686In Range.Replace how to ignore cross referencesBug
WORDSNET-22742System.OverflowException occurs upon loading a XMLBug
WORDSNET-22750System.ArgumentException Illegal characters in path MHTML to HTML conversionBug
WORDSNET-22757Shapes do not render correctly after DOCX to PDF conversionBug
WORDSNET-22759Content misplacement issue upon converting DOCX to PDFBug
WORDSNET-22765Doc to Pdf Conversion with HarfBuzz causes ArithmeticOverflowExceptionBug
WORDSNET-22772Extra vertical spacing added in PDFBug
WORDSNET-22777Import of mhtml differs from what is in browserBug
WORDSNET-22814Range.Replace does not replace the numbers when Number ends with line, section and page breakBug
WORDSNET-22817Convert the SvgReader output APS geometry into EMUs for further rendering in DML codeBug
WORDSNET-22821Space around the barcode is increased after conversion DOC to PDFBug
WORDSNET-22828Extracting Html of a paragraph throws errorsBug
WORDSNET-22834Page break at bookmark position does not workBug
WORDSNET-22837Loading encrypted word File Corrupted ExceptionBug
WORDSNET-22840Missing the image which size is huge in PDF after convert word to PDFBug
WORDSNET-22844Incorrect font substitution for East Asian characters in MathTextElementBug
WORDSNET-22847Fix SonarQube issuesBug

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

WORDSNET-16733Add feature to get the gradient fill properties of a shapeNew Feature
WORDSNET-20073Block level SDT not converting to Editable AcroForm field in PDFNew Feature
WORDSNET-22707Add an ability to use type members of DataRow etc. classes at LINQ Reporting Engine templatesNew Feature
WORDSNET-19181X-Axis numbering in Chart missing in PDFBug
WORDSNET-19183Chart’s starting ending points are not correct in PDFBug
WORDSNET-22044HTML to Word DOCX visibility of Hidden Numbered and Bullet ListsBug
WORDSNET-22050Allow row to break across pages is checked after DOC-HTML-DOCBug
WORDSNET-22573Shape’s contents are lost after DOCX to PDF ConversionBug
WORDSNET-22783Content converge and cause overlapping in PDFBug
WORDSNET-22829getPageCount() returns incorrect page numbersBug
WORDSNET-22848Text bold formatting is lost after DOCX to PDFBug

Public API and Backward Incompatible Changes

This section lists public API changes that were introduced in Aspose.Words 21.11. 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 “USE_ATTACHMENTS” Mode for PDF Rendering

Related issue: WORDSNET-11453

An option has been implemented that allows to display the attachments panel in rendered PDF documents when opened in supporting readers.

The option is specified by setting PdfSaveOptions.page_mode to newly created PdfPageMode.USE_ATTACHMENTS value.

Use Case:

doc = aw.Document("input.docx")

# Specify the new page mode for PDF.
options = aw.saving.PdfSaveOptions();
options.page_mode = aw.saving.PdfPageMode.USE_ATTACHMENTS"output.pdf", options)

Added a new ChmLoadOptions class

Related issue: WORDSNET-22513

Currently, this public class contains a single public property original_file_name. This property allows to specify the name of the CHM file. It is useful if a document is loaded from a stream and it contains links that reference the same document by the file name.

Use Case:

# The input document name.
filename = "myfile.chm"

# Create an input stream of the input document.
input_stream = open(filename, "rb")

# Specify the file name in CHM load options.
# This allows Aspose.Words to correctly resolve URLs like "ms-its:myfile.chm::/index.htm"
load_options = aw.loading.ChmLoadOptions()
load_options.original_file_name = filename

# Load the document.
doc = aw.Document(input_stream , load_options)

Added a new FindReplaceOptions.ignore_field_codes property

Related issue: WORDSNET-22686.

Use Case: Explains how to ignore text inside field codes.

# Create document.
doc = aw.Document()
builder = aw.DocumentBuilder(doc)

# Insert field.
builder.insert_field("INCLUDETEXT", "Text in field")

options = aw.replacing.FindReplaceOptions()

# Replace 'T' in document ignoring text inside field code.
options.ignore_field_codes = True
doc.range.replace_regex("T", u"*", options)

# Replace 'T' in document NOT ignoring text inside field code.
options.ignore_field_codes = False
doc.range.replace_regex("T", u"*", options)

# The code produces the following output:
# \u0013INCLUDETEXT\u0014*ext in field\u0015\u000c
# \u0013INCLUDE*EX*\u0014*ext in field\u0015\u000c

Added new export_images_as_base64 public option

Related issue: WORDSNET-22787

A new export_images_as_base64 public option has been added in MarkdownSaveOptions class.

Use case: Explains how to save Base64 encoded images directly inside a Markdown document.

doc = aw.Document("DocumentWithShape.docx")

mso = aw.saving.MarkdownSaveOptions()
mso.export_images_as_base64 = True"", mso)

Related issue: WORDSNET-22367

New style identifiers for Mention, Smart Hyperlink, Hashtag and Unresolved Mention have been added.

class StyleIdentifier(IntEnum):

    # The Mention style.
    MENTION = 372

    # The SmartHyperlink style.

    # The Hashtag style.
    HASHTAG = 374

    # The UnresolvedMention style.
The styles are undocumented, they do not have their own constants in Micosoft VBA and they are not displayed in MS Word Style Sheet. The styles are added to preserve the document structure invariability, in particular to preserve latent styles when converting Docx to Docx using Aspose.Words.