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
Expand to view the full list of issues.
- Add ‘WordOpenXmlMinimal’ Property to ‘StructuredDocumentTagRangeStart’ Class
- Implement MergeDocuments feature
- Implement ChartLegend.Font public property
- Implement smart indentation for non list paragraphs based on LeftIndent attribute
- System.Drawing dependency removal with Aspose.Drawing
- Performance degradation while simple creation of Document object in 23.9 version
- Blank document saved as image doesn’t contain trial message
- NullReferenceException is thrown upon calling UpdateFields
- MailMerge.GetFieldNames() returns not existing field name if merge field is nested in IF field
- Document corruption after compare
- Fallback images are not used when render Treemap and Sunburst charts using ShapeRenderer
- Loading RTF throws System::InvalidOperationException: Unexpected container type: Shape
- Hyperlinks are removed after open/save
- CompatSettings are missing in latest versions
- Textbox is duplicated as text and as image on conversion from DOCX to Markdown
- Option to generate XLSX output document with single worksheet
- Position of inline shapes is incorrect after rendering
- JS files are detected as Markdown by FileFormatUtil.DetectFileFormat
- Redundant empty pages are rendered
- Comment date is not updated in commentsExtensible.xml
- InvalidOperationException is thrown upon building report with TOC
- Metafiles are not rendered in Linux when MetafileRenderingMode.Bitmap is used
- Masked images are not rendered properly
- Empty documents created by Aspose.Words have different page setup
- ArgumentOutOfRangeException occurs on conversion to PDF
- Updating content controls causing incorrect formatting
- Text in shape is hidden after rendering document
- System.InvalidOperationException: Footnotes are only allowed inside the main text of the document
- Paragraph formatting changed after updating CXP
- Check whether Aspose.Words is affected by CWE-404
- Document layout is incorrect of render from inherited calss
- PDF to DOCX conversion: NullReferenceException
- Metafile is rendered improperly
- DOCX merging issue
- Wrong footnote separator alignment after Merge DOCX
- NullReferenceException is thrown upon rendering document
- Stock chart is rendered improperly to PDF
- Stock chart looks incorrect after rendering
- Font is changed after conversion from PDF to DOCX
- NullReferenceException is thrown upon saving document to MD
- BiDi text is shown incorrectly in Header after Merge DOCX
- Special characters are not recognized while conversion form PDF to DOCX
- Document compare throws “System.NullReferenceException: ‘Object reference not set to an instance of an object.’” exception
- NullReferenceException on conversion document with a chart to PDF
- Bar chart is rendered improperly
- Formulas are not aligned properly when converting to PDF
- LayoutEnumerator does not find page when traverse in forward and backward directions
- Hidden row causes incorrect table rendering
- Fix public generic methods in final xml
- Nested content controls CXP is not updating
- Text in shape is lost after rendering
- Citation sources lost after documents appending
- Shape in header is not visible after conversion to PDF
- NullReferenceException occurs when converting PDF to MD
- Chart title placeholder is shown after building a report
- Hebrew text is imported improperly from HTML
- Text is wrapped incorrectly after rendering
- Content is missing when converting RTF file to DOCX/PNG/PDF/HTML
- Check whether Aspose.Words is affected by CVE-2023-4863
- Fix performance degradation after 21.12 version while adding custom fonts folder
- Font is changed after building report
- TOC page number incorrect
- Mail Merge: HTML Formatting issue in Gmail body
- TOC: Error Bookmark not defined
- Blank DOC file (11kb) as a result of HTML-to-DOC conversion
- Error! Bookmark not defined
- Differences after comparisson
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."""
...
Use Case
This use case explains how to change chart legend font:
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):
...
Use Case
This use case explains how to save all sections of document to same worksheet:
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."""
...
Use Case
This use case explains how to get a string that represents the XML contained within the node in FlatOpc document format.
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
Use Case
This use case explains how to build a report using UpdateFieldsSyntaxAware option:
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.