Aspose.Words for Python via .NET 23.3 Release Notes
Major Features
There are 78 improvements and fixes in this regular monthly release. The most notable are:
- Extended set of public properties for working with fill colors.
- Implemented rendering of radial gradients with SkiaSharp native shader for .NET Standard.
- Added support of InvertIfNegative property for bar chart rendering.
- Implemented saving progress notifications for MOBI and AZW3 formats.
- Added an ability to specify whether to adjust sentence and word spacing automatically upon document import.
Full list of changes
Expand to view the full list of issues, covering all changes in this release.
- Add ability to determine if font color is overridden for Inline node and for paragraph break character
- LINQ Reporting Engine - Column chart does not support different color for negative value
- Allow ImportFormatOptions.AdjustSentenceAndWordSpacing option in API
- Provide public API to manipulate chart gridlines
- Add Fill.ThemeColor option
- Implement plugin license support|New Feature
- Implement rendering of radial gradients with SkiaSharp native shader for .NET Standard
- Enable SaveOptions.ProgressCallback when saving to MOBI
- Enable SaveOptions.ProgressCallback when saving to AZW3
- Implement rendering of a radial gradient into XPS using XPS radial gradient brush
- Add navigation to generated AZW3 documents
- Consider preserving TOC formatting upon exporting to HTML formats
- Preserve TOC Page numbers during Word to HTML to Word round-trip
- Unsupported BMP - Images are not displayed after loading HTML
- Text on metafile is rendered improperly
- XHTML to PDF conversion issue
- Symbols overlap after rendering|Bug
- Additional datapoint is rendered in the line chart
- Czech localized heading style names are not handled when updating STYLEREF fields
- Font size is incorrect after rendering text with revision
- Text orientation is turned to vertical after converting to HTML
- Metafile is rendered improperly in .NET Standard
- PDF file can’t be opened
- Image is rendered improperly in .NET Standard version of Aspose.Words
- Spacing between symbols is incorrect after rendering
- InsertField method throws NullReferenceException when using IF field
- FileCorruptedException is thrown upon loading encrypted DOCX document
- A redundant empty page is produced when render Hebrew document
- Delete paragraph fails when paragraph is inside SDT
- Significant performance decrease upon conversion OfficeMath to string
- HTML to MD: Backslash is appended in name of image in resultant file
- Table with merged cells is recognized improperly
- GroupShape does not render correctly in fixed file format
- FileCorruptedException is thrown upon loading RTF document
- Effects for “thin” elements are not rendered
- Comparison displays wrong document revision
- Footer shows a delete revision after comparing documents
- FileCorruptedException is thrown upon loading DOC document
- Document comparison removes highlighted text
- NullReferenceException is thrown upon comparing documents
- ArgumentNullException is thrown upon calling UpdatePageLayout
- FileCorruptedException is thrown upon loading DOCX document
- Watermark image is missed from document after save to Iso29500_2008_Strict DOCX
- Aspose.Words does not include an empty heading paragraph with numbering into the TOC
- Effects applied to grid lines are not rendered
- Content is pushed down and overlaps footnotes
- Colors are inverted after importing PDF document
- Doted background is rendered in metafile
- FileCorruptedException on loading MHTML
- NullReferenceException on converting DOCX
- Trendline label is not rendered
- Text behind images in PDF conversion
- List item tabs are rendered bigger than required
- List tab stop is incorrect after rendering
- Part of TC field becomes visible after conversion to RTF
- Allow creating DML Shape from public API
- Shape position and size is changed after open/save document
- HTML to MD: Table of content does not lead to content
- PdfCompositeEncodingConvertor throws ArgumentOutOfRangeException
- Arabic text in SVG is rendered inaccurately in case of font fallback
- Problem loading document
- HTM loading issue
- ReportingEngine, when reading Async Method throws exception in the document
- Bookmark from headings are not created saving to PDF
- XML to PDF incorrect formatting
- Empty output document after converting from CHM to DOCX
- Exception is thrown while saving DOCX to image format under Linux
- OutOfMemoryException throws when document is saved
- Table Front style issue while converting Word to HTML to word document
- HTML to PDF conversion generates incorrect output
- InvalidOperationException on UpdatePageLayout after inserting HTML via DocumentBuilder
- Tables width increase beyond the Page width during Word to HTML to Word round-trip
- The use of ExportListLabels.AsInlineText value for HtmlOptions.ExportListLabels option can raise System.InvalidOperationException
- Problems to covert html containing element located in absolute position into PDF
- The delta character in a math formula is replaced with the V character
- NullReferenceException is thrown upon rendering document
- Image elements in absolute positions in HTML are not displayed in Word
- Aspose.Word .NET Core Performance Problem
Public API and Backward Incompatible Changes
This section lists public API changes that were introduced in Aspose.Words for Python via .NET 23.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 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 new public properties for working with fill colors
A new public properties fore_theme_color and back_theme_color has been added to class Fill.
@property
def fore_theme_color(self) -> aspose.words.themes.ThemeColor:
'''Gets or sets a ThemeColor object that represents the foreground color for the fill.'''
...
@fore_theme_color.setter
def fore_theme_color(self, value: aspose.words.themes.ThemeColor):
...
@property
def back_theme_color(self) -> aspose.words.themes.ThemeColor:
'''Gets or sets a ThemeColor object that represents the background color for the fill.'''
...
@back_theme_color.setter
def back_theme_color(self, value: aspose.words.themes.ThemeColor):
...
A new public properties fore_tint_and_shade and back_tint_and_shade has been added to class Fill.
@property
def fore_tint_and_shade(self) -> float:
'''Gets or sets a double value that lightens or darkens the foreground color.
The allowed values are within the range from -1 (the darkest) to 1 (the lightest) for this property.
Zero (0) is neutral. Attempting to set this property to a value less than -1 or more than 1
results in System.ArgumentOutOfRangeException.'''
...
@fore_tint_and_shade.setter
def fore_tint_and_shade(self, value: float):
...
@property
def back_tint_and_shade(self) -> float:
'''Gets or sets a double value that lightens or darkens the background color.
The allowed values are within the range from -1 (the darkest) to 1 (the lightest) for this property.
Zero (0) is neutral. Attempting to set this property to a value less than -1 or more than 1
results in System.ArgumentOutOfRangeException.'''
...
@back_tint_and_shade.setter
def back_tint_and_shade(self, value: float):
...
Use Case:
Explains how to work with theme colors and tint and shade.
import typing
from aspose.words import Document, DocumentBuilder, NodeType
from aspose.words.drawing import Shape
from aspose.words.themes import ThemeColor
doc = Document("in.docx")
shape = doc.get_child(NodeType.SHAPE, 0, True)
shape_fill = typing.cast(Shape, shape).fill
'''Gets and sets the value of theme colors.'''
if shape_fill.fore_theme_color == ThemeColor.ACCENT1:
shape_fill.fore_theme_color(ThemeColor.DARK1)
if shape_fill.back_theme_color == ThemeColor.ACCENT2:
shape_fill.back_theme_color(ThemeColor.DARK2)
text_fill_1 = doc.first_section.body.first_paragraph.runs[0].font.fill
'''Gets and sets the tint value.'''
if text_fill_1.fore_tint_and_shade == 0:
text_fill_1.fore_tint_and_shade(0.5)
text_fill_2 = doc.first_section.body.first_paragraph.runs[1].font.fill
'''Gets and sets the shade value.'''
if text_fill_2.fore_tint_and_shade == 0:
text_fill_2.fore_tint_and_shade(-0.2)
doc.save("output.docx")
Added public properties has_major_gridlines and has_minor_gridlines to ChartAxis class
The following public properties have been added to the aspose.words.drawing.charts.ChartAxis class:
@property
def has_major_gridlines(self) -> bool:
'''Gets or sets a flag indicating whether the axis has major gridlines.'''
...
@has_major_gridlines.setter
def has_major_gridlines(self, value: bool):
...
@property
def has_minor_gridlines(self) -> bool:
'''Gets or sets a flag indicating whether the axis has minor gridlines.'''
...
@has_minor_gridlines.setter
def has_minor_gridlines(self, value: bool):
...
Use Case:
Explains how to show chart gridlines.
from aspose.words import Document, DocumentBuilder
from aspose.words.drawing.charts import ChartType
doc = Document()
builder = DocumentBuilder(doc)
'''Insert a chart.'''
shape = builder.insert_chart(ChartType.COLUMN, 432, 252)
x_axis = shape.chart.axis_x
y_axis = shape.chart.axis_y
'''Show gridlines.'''
x_axis.has_major_gridlines(True)
x_axis.has_minor_gridlines(True)
y_axis.has_major_gridlines(True)
y_axis.has_minor_gridlines(True)
doc.save("Gridlines.docx")
Added public property ImportFormatOptions.adjust_sentence_and_word_spacing
The following public property was added to aspose.words.ImportFormatOptions class:
@property
def adjust_sentence_and_word_spacing(self) -> bool:
'''Gets or sets a boolean value that specifies whether to adjust sentence and word spacing automatically.
The default value is ``False``.'''
...
@adjust_sentence_and_word_spacing.setter
def adjust_sentence_and_word_spacing(self, value: bool):
...
Use Case:
Explains how to use adjust_sentence_and_word_spacing option.
from aspose.words import Document, DocumentBuilder, ImportFormatOptions, ImportFormatMode
src_doc = Document()
dst_doc = Document()
builder = DocumentBuilder(src_doc)
builder.write("Dolor sit amet.")
builder = DocumentBuilder(dst_doc)
builder.Write("Lorem ipsum.")
options = ImportFormatOptions()
options.adjust_sentence_and_word_spacing(True)
builder.InsertDocument(src_doc, ImportFormatMode.USE_DESTINATION_STYLES, options);
print(dst_doc.first_section.body.first_paragraph.get_text())
'''This code produces the following output (please note the additional ' ' space character just before pasted content):
Lorem ipsum. Dolor sit amet.
'''
Added public property TextBox.no_text_rotation
The following public property was added to aspose.words.drawing.TextBox class:
@property
def no_text_rotation(self) -> bool:
'''Gets or sets a boolean value indicating either text of the TextBox should not rotate when the shape is rotated.
The default value is ``False``'''
...
@no_text_rotation.setter
def no_text_rotation(self, value: bool):
...
Use Case:
Explains how to use NoTextRotation option.
from aspose.words import DocumentBuilder
from aspose.words.drawing import ShapeType
builder = DocumentBuilder()
shape = builder.insert_shape(ShapeType.ELLIPSE, 20, 20)
shape.text_box.no_text_rotation(True)
Enabled saving progress notifications for MOBI and AZW3 formats
The SaveOptions.ProgressCallback is now also invoked when saving to Mobi or AZW3.