Browse our Products

Aspose.Words for Python via .NET 22.9 Release Notes

Major Features

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

  • TxtLoadOptions was extended with new auto_numbering_detection option.
  • Implemented an ability to cache the header/footer shapes to reduce the size of the output PDF file.
  • Added a new feature to get FieldEQ as OfficeMath.
  • Allowed creation of structured document tags of Group type at Row level.
  • Added Python type hints for all classes.

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

KeySummaryCategory
WORDSNET-5844Custom Table border style is rendering incorrectly in Fixed Page FormatsNew Feature
WORDSNET-13166Implement caching of watermarks through frame xObjectsNew Feature
WORDSNET-17215Table borders are not correct in PDFNew Feature
WORDSNET-22966Add feature to render the comments according to preferred languageNew Feature
WORDSNET-24126Inaccurate spacing between shape and next line text in footerNew Feature
WORDSNET-24144Allow creating SDT of Group type on Row levelNew Feature
WORDSNET-5288Table borders looks incorrectly after converting to PDFEnhancement
WORDSNET-7205Cell borders are getting lost when rendering to PDFEnhancement
WORDSNET-15408Conversion from RTF to PDF using Words results in a squished tableEnhancement
WORDSNET-16836PDF rendition differs from the source documentEnhancement
WORDSNET-24124Outset border type is not rendered correctly in presence of cell spacingEnhancement
WORDSNET-10996Add possiblity to generate PDF of Minimum Size (Publishing Online)Bug
WORDSNET-18373DOCX to PDF conversion issue with line wrapping in the middle of Russian wordBug
WORDSNET-18530Incorrect calculation of NUMPAGES fields in PDFBug
WORDSNET-18559DOCX to PDF conversion issue with text renderingBug
WORDSNET-18637DOCX to HTML conversion issue with background color of paragraphBug
WORDSNET-18759DOCX to PDF conversion issue with word wrappingBug
WORDSNET-20308Y-Axis labels are changed after DOCX to PDF conversionBug
WORDSNET-20613Word to pdf files become hundreds of times largerBug
WORDSNET-20748Text moves to next line after DOCX to PDF conversionBug
WORDSNET-21064Fill entire DIV with lightblue background-color during HTML to Word ConversionBug
WORDSNET-22229Content are lost after DOCX to PDF conversionBug
WORDSNET-22815Issues after Set XML MappingBug
WORDSNET-22894Frame is lost after RTF to PDF conversionBug
WORDSNET-22920DOCX to PDF conversion breaks words and wraps parts of words to the next lineBug
WORDSNET-22945Preserve RestartPageNumbering section property during DOCX HTML roundtrip sessionBug
WORDSNET-23030ZlibException: Bad state Unknown compression methodBug
WORDSNET-23112Spaces between images are lostBug
WORDSNET-23113Images with SMask bigger than original image are processed incorrectlyBug
WORDSNET-23174IndexOutOfRangeException in LibTiff library codeBug
WORDSNET-23208InvalidOperationException at PdfObjectStreamParseObjectBug
WORDSNET-23624Data label values order is changed upon renderingBug
WORDSNET-23636Chart legend is cut of at the bottomBug
WORDSNET-23645Data labels values are rendered improperlyBug
WORDSNET-23669Header contents do not match on wml to docx conversionBug
WORDSNET-23748Incorrect paragraph break font size in AW document model for a WML documentBug
WORDSNET-23787Incorrect page margins on wml to docx conversionBug
WORDSNET-23833LINQ Reporting Engine always considers JSON null literals as string valuesBug
WORDSNET-23858ArgumentOutOfRangeException is thrown upon conversion DOCX to HTMLBug
WORDSNET-23887Caption Ref present on first para get missingBug
WORDSNET-23903Text is overlapped after rendering SVG imageBug
WORDSNET-23934An image is scaled down in AW document model on reading and RTF documentBug
WORDSNET-23943Abort pdf2word builds by timeoutBug
WORDSNET-23962Issue with line spacing when converting odt to docxBug
WORDSNET-24000Text is wrapped improperly upon renderingBug
WORDSNET-24001Frame in header lost on conversion to PDFBug
WORDSNET-24008AW renders invisible text inside text boxBug
WORDSNET-24009LayoutCollectorGetStartPageIndex returns incorrect page number for shape in nested tableBug
WORDSNET-24021StackOverflowException upon loading a HTML documentBug
WORDSNET-24022Revisions are rendered in wrong placesBug
WORDSNET-24047Remove CodePorting attributes from release buildBug
WORDSNET-24062RTL content is reversed and has spaces after importing PDFBug
WORDSNET-24063RTL TOC is corrupted after importing PDF documentBug
WORDSNET-24083IndexOutOfRangeException is thrown upon rendering documentBug
WORDSNET-24093Issue with conversion Word to PDFBug
WORDSNET-24107Blurry text occurs aftet PDF to JPG conversion via PdfFixedRendererBug
WORDSNET-24109Text wrapping is incorrect after renderingBug
WORDSNET-24116New style introduced after updating CXPBug
WORDSNET-24120Invalid positioning and alignment of elements when appending DOCX documentsBug
WORDSNET-24125FileCorruptedException is thrown upon loading DOCX documentBug
WORDSNET-24127Header row is duplicated when use ExtractPages methodBug
WORDSNET-24133Hidemark handling is not rightBug
WORDSNET-24140Nested bookmark is removed after setting text of outer bookmarkBug
WORDSNET-24169SDT to custom XML mapping wrong list numberingBug
WORDSNET-24174Floating table position property changes on conversion to docxBug
WORDSNET-24177Page orientation is not preserved after DOCX HTML roundtripBug
WORDSNET-24178Exception is thrown when converting DOCX to HTMLBug
WORDSNET-24180Content moved to next page and extra page createdBug
WORDSNET-24181Incorrect nodes order in AW document model for a wml documentBug
WORDSNET-24182Incorrect paragraphs count in AW document model for a WML documentBug
WORDSNET-24185NullReferenceException is thrown upon getting ChildNodes from imported StructuredDocumentTagRangeStartBug
WORDSNET-24186NullReferenceException is thrown upon rendering document with chartBug
WORDSNET-24190Paragraph formatting is not the same in the output fileBug
WORDSNET-24196IndexOutOfRangeException when converting RTF to PDFBug
WORDSNET-24199ArgumentException because of an empty key in CustomDocumentPropertiesBug
WORDSNET-24205Tr class name cannot be used when AsposeWords is referencedBug
WORDSNET-24207Incorrect handling of underline text display for formulasBug
WORDSNET-24211Series data is not rendered on the chart areaBug
WORDSNET-24214Update links in tests and test files to use new wikiBug
WORDSNET-24218Embedded SVG fragments are indented incorrectly when saved with PrettyFormat enabledBug
WORDSNET-24219Saving docx document to markdown throws exceptionBug
WORDSNET-24220InvalidOperationException is thrown upon comparing documentsBug
WORDSNET-24231Smart Arts are converted to imagesBug
WORDSNET-24234NullReferenceException on UpdatePageLayout on document with chartsBug
WORDSNET-24236FileCorruptedException on loading DOCX documentBug
WORDSNET-24242NullReferenceException when saving AZW3 to streamBug
WORDSNET-24251OutOfMemoryException is thrown upon importing RTF documentBug
WORDSNET-24258Incorrect display of the radical character for the case of subscript as an argumentBug
WORDSNET-24275Cannot save to Azw3 when saving to streamBug

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

KeySummaryCategory
WORDSNET-22351UpdatePageLayout invalidates PrintDate fields values in Header FootersBug
WORDSNET-23551Add an ability to convert EQ field to OfficeMathBug
WORDSNET-23562Numbers with decimal point are mistakenly detected as list item upon loading TXT documentBug
WORDSNET-24100CommentAddReply adds reply as a separate comment instead of replyBug
WORDSNET-24139CN-CODE128 font is substituted with Courier NewBug
WORDSNET-24145CardText merge field is not localized to ItalianBug
WORDSNET-24153FileCorruptedException is thrown upon loading RTF documentBug
WORDSNET-24163Word to PDF Missing contentBug
WORDSNET-24168Text wrapping is incorrect after rendering SVGBug
WORDSNET-24226DOCX to PDF Text is not alligned properlyBug
WORDSNET-24230Thick cell borders are rendered with artifactsBug
WORDSNET-24249Comparing the document with its exact copy shows a differenceBug
WORDSNET-24253Tab with leader at the end of line is missed upon renderingBug

Public API and Backward Incompatible Changes

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

Related issue: WORDSNET-23551

The following public method is added to FieldEQ class:

class FieldEQ:
    ...
    def as_office_math(self) -> OfficeMath:
        """Returns Office Math object corresponded to the EQ field.
        
        Returns None if field code is empty or invalid, otherwise an OfficeMath instance."""
        ...

Use Case: Replace EQ fields with Office Math.

document = aw.Document(file_name)
for field in document.range.fields:
    if field.type == aw.fields.FieldType.FIELD_EQUATION:
        office_math = field.as_field_eq().as_office_math()

        field.start.parent_node.insert_before(office_math, field.start)
        field.remove()

Use Case: Import Office Math to another document.

document = aw.Document(file_name)
new_document = aw.Document()

for field in document.range.fields:
    if field.type == aw.fields.FieldType.FIELD_EQUATION:
        office_math = field.as_field_eq().as_office_math()

        new_document.first_section.body.first_paragraph.append_child(new_document.import_node(office_math, True))

Added new TxtLoadOptions.auto_numbering_detection property

Related issue: WORDSNET-23562.

The following public property is added to TxtLoadOptions class:

class TxtLoadOptions:
    ...
    @property
    def auto_numbering_detection(self) -> bool:
        """Gets or sets a boolean value indicating either automatic numbering detection
        will be performed while loading a document.
        
        The default value is True."""
        ...

Use Case: Explains how to disable automatic numbering detection upon loading TXT document.

# Disable automatic numbering detection.
options = aw.loading.TxtLoadOptions()
options.auto_numbering_detection = False
doc = aw.Document("input.txt", options)

list_items_count = 0
for node in doc.get_child_nodes(aw.NodeType.PARAGRAPH, True):
    paragraph = node.as_paragraph()
    if paragraph.is_list_item:
        list_items_count += 1

print(
    "The expected number of list items in document with 'auto_numbering_detection' option disabled is 0," +
    " and the actual is", list_items_count)

# The code produces the following output:
# The expected number of list items in document with 'auto_numbering_detection' option disabled is 0, and the actual is 0

Related issues: WORDSNET-13166, WORDSNET-20613, WORDSNET-10996

The following public property is added to PdfSaveOptions class:

class PdfSaveOptions:
    ...
    @property
    def cache_header_footer_shapes(self) -> bool:
        """Gets or sets a value determining whether or not to cache shapes placed in header and footer of document.
        
        Default value is False and shapes are not cached.
        When the value is True shapes graphics are written to the PDF document as an xObject.
        Some shapes are not supported for caching(shapes with fields, bookmarks, HRefs)."""
        ...

The new property allows you to cache the header/footer shapes and reduce the size of PDF output file.

Use Case:

doc = aw.Document(file_name)
save_options = aw.saving.PdfSaveOptions()
save_options.cache_header_footer_shapes = True
doc.save(output_file_name, save_options)

Allowed creation of structured document tags of Group type at Row level

Related issue: WORDSNET-24144

You can now create SdtType.GROUP structured document tags at the MarkupLevel.ROW level.

Use Case:

doc = aw.Document()
builder = aw.DocumentBuilder(doc)

# Insert a table.
table = builder.start_table()

# Create a Group structured document tag at the Row level.
group_sdt = aw.markup.StructuredDocumentTag(doc, aw.markup.SdtType.GROUP, aw.markup.MarkupLevel.ROW)
table.append_child(group_sdt)
group_sdt.is_showing_placeholder_text = False
group_sdt.remove_all_children()

# Create a child row of the structured document tag.
row = aw.tables.Row(doc)
group_sdt.append_child(row)

# Append a cell.
cell = aw.tables.Cell(doc)
row.append_child(cell)

builder.end_table()

# Insert cell contents.
cell.ensure_minimum()
builder.move_to(cell.last_paragraph)
builder.write("Some text 1")

# Insert text after the table.
builder.move_to(table.next_sibling)
builder.write("Some text 2")

doc.save("Out.docx")