Browse our Products

Aspose.Words for Python via .NET 23.11 Release Notes

Major Features

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

  • Added an ability to specify the default font formatting for legend entries of DrawingML charts.
  • Provided an ability to write all sections of the document to the same XLSX worksheet.

Full List of Issues Covering all Changes in this Release

Public API and Backward Incompatible Changes

This section lists public API changes that were introduced in Aspose.Words for Python via .NET 23.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 for Python via .NET 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 public property ChartLegend.font

The new property ChartLegend.font has been implemented. It allows setting the default font formatting for legend entries.

class ChartLegend:
    """Represents chart legend properties.

    @property
    def font(self) -> aspose.words.Font:
        """Provides access to the default font formatting of legend entries. To override the font formatting for
        a specific legend entry, use the:attr:`ChartLegendEntry.font` property."""
        ...

from aspose.words import Document, NodeType
doc = Document("Reporting engine template - Chart series.docx")
shape = doc.get_child(NodeType.SHAPE, 0, True).as_shape()
chart = shape.chart

chart_legend = chart.legend
# Set default font size all legend entries.
chart_legend.font.size = 14
# Change font for specific legend entry.
chart_legend.legend_entries[1].font.italic = True
chart_legend.legend_entries[1].font.size = 12

doc.save("Charts.LegendFont.docx")

Added public property XlsxSaveOptions.section_mode and enum type XlsxSectionMode

A new enumeration type XlsxSectionMode and a new property XlsxSaveOptions.section_mode of this type have been implemented.

class XlsxSectionMode(Enum):
    """Specifies how sections are handled when saving a document in the XLSX format."""
    
    """Specifies that a separate worksheet is created for each section of a document."""
    MULTIPLE_WORKSHEETS: int
    
    """Specifies that all sections of a document are saved on one worksheet."""
    SINGLE_WORKSHEET: int

class XlsxSaveOptions(aspose.words.saving.SaveOptions):
    """Can be used to specify additional options when saving a document into the :attr:`aspose.words.SaveFormat.XLSX`
    format.
    """
    @property
    def section_mode(self) -> aspose.words.saving.XlsxSectionMode:
        """Gets or sets the way how sections are handled when saving to the output XLSX document.
        The default value is :attr:`XlsxSectionMode.MULTIPLE_WORKSHEETS`."""
        ...
    
    @section_mode.setter
    def section_mode(self, value: aspose.words.saving.XlsxSectionMode):
        ...

from aspose.words import Document
from aspose.words.saving import XlsxSaveOptions, XlsxSectionMode

doc = Document("document.docx")

# Each section of a document will be created as a separate worksheet.
# Use 'SingleWorksheet' to display all document on one worksheet.

xlsx_save_options = XlsxSaveOptions()
xlsx_save_options.section_mode = XlsxSectionMode.MULTIPLE_WORKSHEETS

doc.save("XlsxSaveOptions.SelectionMode.xlsx", xlsx_save_options)

Added public word_open_xml_minimal for StructuredDocumentTagRangeStart node

New public property has been added to StructuredDocumentTagRangeStart node:

 @property
    def word_open_xml_minimal(self) -> str:
        """Gets a string that represents the XML contained within the node in the :attr:`aspose.words.SaveFormat.FLAT_OPC` format.
        
        Unlike the :attr:`StructuredDocumentTagRangeStart.word_open_xml` property, this method generates a stripped-down document that excludes any non-content-related parts."""
        ...

from aspose.words import Document, NodeType

doc = Document("Multi-section structured document tags.docx")

tag = doc.get_child(NodeType.STRUCTURED_DOCUMENT_TAG_RANGE_START, 0, True).as_structured_document_tag_range_start()

self.assertTrue(tag.word_open_xml_minimal.find(
    "<pkg:part pkg:name=\"/docProps/app.xml\" pkg:contentType=\"application/vnd.openxmlformats-officedocument.extended-properties+xml\">") > 0)
self.assertTrue(tag.word_open_xml_minimal.find(
    "xmlns:w16cid=\"http://schemas.microsoft.com/office/word/2016/wordml/cid\"") < 0)

Added the ReportBuildOptions.UPDATE_FIELDS_SYNTAX_AWARE enum member

The following member has been added to the ReportBuildOptions enum:

    """Specifies that the engine should ignore template syntax in field results and update fields after a report
    is built."""
    UPDATE_FIELDS_SYNTAX_AWARE: int

from aspose.words import Document
from aspose.words.reporting import ReportBuildOptions, ReportingEngine

doc = Document("Reporting engine template - Fields.docx")

# Note that enabling of the option makes the engine to update fields while building a report,
# so there is no need to update fields separately after that.

engine = ReportingEngine()
engine.options = ReportBuildOptions.UPDATE_FIELDS_SYNTAX_AWARE

engine.build_report(doc, ["First topic", "Second topic", "Third topic"], "topics")
doc.save("ReportingEngine.UpdateFieldsSyntaxAware.docx")

The obsolete property HtmlSaveOptions.epub_navigation_map_level was removed

The obsolete HtmlSaveOptions.epub_navigation_map_level property was removed. The HtmlSaveOptions.navigation_map_level should be used instead.