Browse our Products
Aspose.Words for Python via .NET 26.3 Release Notes
Major Features
There are 34 improvements and fixes in this regular monthly release. The most notable are:
- AI Integration: Added the ability to create an instance of the OpenAiModel class directly.
- Document Optimization: Extended the functionality of the JoinRunsWithSameFormatting method for more comprehensive content merging.
- Rendering and Fonts: Improved the MS Office font fallback table for the CJK Unified Ideographs Extension G range.
Full List of Issues Covering all Changes in this Release
Expand to view the full list of issues.
- Allow to create instance of OpenAiModel class directly
- Support MSO properties during import tabs
- MathML: mmultiscripts is incorrectly imported
- Incorrect rendering of SVG when the gradient is specified with ‘objectBoundingBox’ and exceeds the path bounds
- PDF to Word font substitution warning about Fanwood font
- InvalidOperationException is thrown upon saving document as DOCX
- SVG gradient in userSpaceOnUse coordinates is rendered incorrectly
- Unexpected DocumentBuilder behavior when moving inside SDT
- Import of MsoHtml lists differs from MS Word’s result
- List items are imported from MsoHtml as normal paragraphs
- DOCX to PDF: Headers and footers disappear after section break
- FileCorruptedException is thrown upon loading ‘.wml’ document
- ArgumentOutOfRangeException is thrown upon using AutoFitBehavior.AutoFitToWindow
- SVG color gradients are corrupted when exporting to DOC
- SVG color gradients are corrupted when exporting to PDF
- Compare result does not match MS Word
- NullReferenceException is thrown upon building document layout
- Layout issue when converting DOCX to PDF
- RTF to PDF: Converting the file raises an exception
- Chinese character is rendered as missed character
- TOC is split into two parts in the document structure
- Gradient is lost after rendering SVG
- Metafile is rendered incorrectly in Vector mode
- IndexOutOfRangeException is thrown upon building document layout
- Numbering is changed after exporting to HTML
- Document.AcceptAllRevisions does not accept all revisions
- ODT file fails to load with FileCorruptedException
- Update Metered license code
- NullReferenceException is thrown upon exporting to HTML with ExportListLabels.ByHtmlTags
- DOCX to PDF: Additional spacing at the start of paragraph
- JoinRunsWithSameFormatting does not join runs
- Remove obsolete TableStyle.Bidi property
- Table is slightly shifted right after rendering
- Exporting list labels by HTML tags does not work
This section lists public API changes that were introduced in Aspose.Words for Python via .NET 26.3. 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 ability to create instance of OpenAiModel class directly
Now, you can create Aspose.Words.AI.OpenAiModel class directly.
This use case explains how to create instance of OpenAiModel class and summarize a document:
api_key = system_helper.environment.Environment.get_environment_variable("API_KEY")
# Create an OpenAI model instance using the constructor with model name and API key.
model = aw.ai.OpenAiModel(name="gpt-4o-mini", api_key=api_key)
doc = aw.Document(file_name=MY_DIR + "Big document.docx")
# Summarize the document using the OpenAI model with short summary length.
summarize_options = aw.ai.SummarizeOptions()
summarize_options.summary_length = aw.ai.SummaryLength.VERY_SHORT
summary = model.summarize(source_document=doc, options=summarize_options)
summary.save(file_name=ARTIFACTS_DIR + "OpenAiModel.OpenAiModelConstructor.docx")The functionality of JoinRunsWithSameFormatting method has been extended
A new public method JoinRunsWithSameFormatting with the extended functionality has been added to Paragraph class:
This use case explains how to work with JoinRunsWithSameFormatting(JoinRunsOptions options):
doc = aw.Document()
builder = aw.DocumentBuilder(doc=doc)
# Create runs with identical visible formatting but some internal differences.
builder.font.name = 'Arial'
builder.font.size = 12
builder.write('Hello ')
builder.write('world')
# Verify runs before join.
self.assertEqual(2, doc.first_section.body.first_paragraph.runs.count)
self.assertEqual('Hello ', doc.first_section.body.first_paragraph.runs[0].text)
self.assertEqual('world', doc.first_section.body.first_paragraph.runs[1].text)
# Configure options to ignore redundant and insignificant attributes during join.
options = aw.JoinRunsOptions()
options.ignore_redundant = True # Ignore redundant run properties that don't affect appearance.
options.ignore_insignificant = True # Ignore insignificant differences like whitespace-only runs.
# Join runs that have the same visible formatting using the extended options.
doc.first_section.body.first_paragraph.join_runs_with_same_formatting(options)
# Verify that runs were successfully joined.
self.assertEqual(1, doc.first_section.body.first_paragraph.runs.count)
self.assertEqual('Hello world', doc.first_section.body.first_paragraph.runs[0].text)
doc.save(file_name=ARTIFACTS_DIR + 'Paragraph.JoinRunsWithSameFormattingWithOptions.docx')Removed obsolete TableStyle.Bidi property
Removed obsolete bidi property from Aspose.Words.TableStyle class:
There is no such property in Word GUI for Table styles. Also, Word doesn’t allow to set this property for Table styles in VBA. Aspose.Words now also does not provide this property in the public API to mimic MS Word.