Browse our Products
Aspose.Words for Python via .NET 24.4 Release Notes
Major Features
There are 91 improvements and fixes in this regular monthly release. The most notable are:
- Modern image format WEBP is now supported in Aspose.Words.
- Added an ability to embed fonts declared in @font-face rules into the resulting document’s font definitions.
- Chart API was extended with new popular options.
- Provided an ability to specify sign options for the documents in SaveOptions.
- Implemented an ability to work with glow and reflection formatting for the drawing object.
Full List of Issues Covering all Changes in this Release
Expand to view the full list of issues.
- Consider providing a property to specify digital hash algorithm used by a digital signature in DigitalSignatureUtil
- Add property ExportTextInputFormFieldAsText to HtmlFixedSaveOptions
- Support of CSS3 font-face Rule
- Add feature to change the font size and name of text in the chart
- Implement WebP format support
- Add public API to get/set MirrorIndents paragraph property
- Add the ability to set font formatting, as well as fill and stroke for the remaining chart elements
- Consider providing sign document option in SaveOptions for DOC, DOCX, ODT and XPS as we have for PDF
- New method for removing blank pages
- Consider reading linked web fonts during importing HTML
- Images render as corss after docx to DOC/PDF
- ArgumentException is thrown upon insertion an image
- Last table column is partially clipped at right after rendering
- Get coordinates of bounding box for TTGlyph
- Different table height in AW PDF output
- DOCX to MD: Tables are not indented
- Image is lost after conversion from DOCX to HtmlFixed
- Images are replaced by the red crosses on conversion from DOCX to PDF
- JPEG image is rendered as a red cross
- Part of content is moved to previous page
- GIF image cannot be inserted into the document
- XML document is detected as TEXT by FileFormatUtil.DetectFileFormat
- Position of tabstops in footer is wrong
- Positioning issue of full-width punctuations after conversion from Word Document to PDF
- Different line wrapping in a hyphenated document causes different page count in AW layout
- AgilentSymbolOne font is not used upon rendering even if it is available in font source
- Stack routine and FieldBundle refactoring
- DOCX->HTML->DOCX: Custom headings not retained after roundtrip
- Spacing and word-wrap is incorrect after rendering document
- MathLineBreak does not affect the formula when rendering to PDF
- Properties of hidden paragraph inside Sdt are not ignored by Word
- Aspose.Words Blazor Performance
- OverflowException on DOCX to XLSX: Not a legal OleAut date
- Saved XLSX document has an issue
- Implement MS Word 2013 hyphenation logic between pages and columns
- Shapes positions are incorrect after rendering
- DOCX to PDF conversion comparing to Microsoft Word
- Punctuation character overlaps Chinese character on rendering to fixed-page formats
- Incorrectly indenting list upon save document
- Implement hyphenation logic between pages and columns
- Line of text is moved to previous page upon rendering
- Allow setting LinkedStyleName property
- DOCX to PDF with Hyphenation: Content not split correctly on page break
- The quotes character overlaps other characters
- List items in ca_ES locale are rendered as English
- List labels have incorrect font-size after DOCX->HTML->DOCX conversion
- NullReferenceException is thrown upon rendering document
- Table indent reported by AW model is different from MS Word
- InvalidOperationException is thrown upon rendering document with ShowInBalloons.Format
- NotSupportedException is thrown upon saving document as DOC to stream in python
- InvalidOperationException is thrown upon updating fields
- Table formatting is broken after open/save WordML file
- Incorrect PDF file reading
- Line spacing is incorrect if specify EditingLanguage.ChinesePRC
- Table position is changed after comparting documents
- Hyperlink address is truncated f contains Unicode characters
- AutoOpen macros does not work after converting DOT to DOC
- Bracket shape has wrong Filled property
- Table width is incorrect after rendering
- NullReferenceException is thrown upon rendering document after updating fields
- Text inside textboxes are lost after conversion
- REF field value is not shown after DOTM to DOC conversion
- Pdf2Word. Incorrect position and alpha channel of XForm content
- Save to PDF uses wrong font
- Header is lost when ExtractPages is used after HeadersFooters.LinkToPrevious
- Offsets befroe and after bracket element, based on type of neighbor element
- InvalidOperationException is thrown upon comparing document
- Incorrect rendering of Nary in structured document tag
- Add support to get Glow effect of a Shape
- Add support to get Reflection effect of a Shape
- Table borders are lost after open/save document
- DOCX document merging issue
- Aspose.Words finds a difference in field code, while MS Word doe snot see any difference
- Negative value is formatted improperly
- Bullet characters are not rendered properly
- NullReferenceException is thrown upon saving document the second time
- Image is lost after rendering document
- Hyphenation does not match MS Word after rendering
- Export shape with screen tip without reference to HTML should generate a title attribute
- Underline is lost after appending document
- Replacing content in tracked document
- Tables inside the merged document split between pages
- Font inherited from Normal style is explicitly set after importing Style with ImportFormatMode.UseDestinationStyles
- Paragraph’s font isn’t preserved after HTML->HTML conversion.
- PDF to DOCX: Corrupted output file
- Table formatting is broken after converting WML to DOC
- font-face rule is ignored on import from HTML
- Font is changed from ‘CiscoSans’ to ‘Arial’ after reading HTML document
- PDF output contains an extra empty space added in every entry of the numbered list
- Assertion when converting a Word document to PDF
- Saved XPS will not print on a Type 3 printer driver
Public API and Backward Incompatible Changes
This section lists public API changes that were introduced in Aspose.Words for Python via .NET 24.4. 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 an ability to work with Glow effect of a shape
Implemented new public class in aspose.words.drawing namespace:
class GlowFormat:
"""Represents the glow formatting for an object.
Use the :attr:`ShapeBase.glow` property to access glow properties of an object.
You do not create instances of the :class:`GlowFormat` class directly."""
def remove(self) -> None:
"""Removes :class:`GlowFormat` from the parent object."""
...
@property
def color(self) -> aspose.pydrawing.Color:
"""Gets or sets a aspose.pydrawing.Color object that represents the color for a glow effect.
The default value is aspose.pydrawing.Color.black."""
...
@color.setter
def color(self, value: aspose.pydrawing.Color):
...
@property
def transparency(self) -> float:
"""Gets or sets the degree of transparency for the glow effect as a value between 0.0 (opaque) and 1.0 (clear).
The default value is 0.0."""
...
@transparency.setter
def transparency(self, value: float):
...
@property
def radius(self) -> float:
"""Gets or sets a double value that represents the length of the radius for a glow effect in points (pt).
The default value is 0.0."""
...
@radius.setter
def radius(self, value: float):
...
...
Also added new public property to ShapeBase class:
@property
def glow(self) -> aspose.words.drawing.GlowFormat:
"""Gets glow formatting for the shape."""
...
This use case explains how to work with the glow of a shape:
import aspose.words as aw
import aspose.pydrawing
doc = aw.Document("Various shapes.docx")
shape = doc.get_child(aw.NodeType.SHAPE, 0, True).as_shape()
shape.glow.color = aspose.pydrawing.Color.salmon
shape.glow.radius = 30
shape.glow.transparency = 0.15
doc.save("Shape.Glow.docx")
doc = aw.Document("Shape.Glow.docx")
shape = doc.get_child(aw.NodeType.SHAPE, 0, True).as_shape()
self.assertEqual(aspose.pydrawing.Color.from_argb(217, 250, 128, 114).to_argb(), shape.glow.color.to_argb())
self.assertEqual(30, shape.glow.radius)
self.assertAlmostEqual(0.15, shape.glow.transparency, delta=0.01)
shape.glow.remove()
self.assertEqual(aspose.pydrawing.Color.black.to_argb(), shape.glow.color.to_argb())
self.assertEqual(0, shape.glow.radius)
self.assertEqual(0, shape.glow.transparency)
Added an ability to work with Reflection effect of a shape
Implemented new public class in aspose.words.drawing namespace:
class ReflectionFormat:
"""Represents the reflection formatting for an object.
Use the :attr:`ShapeBase.reflection` property to access reflection properties of an object.
You do not create instances of the :class:`ReflectionFormat` class directly."""
def remove(self) -> None:
"""Removes :class:`ReflectionFormat` from the parent object."""
...
@property
def blur(self) -> float:
"""Gets or sets a double value that specifies the degree of blur effect applied to the reflection effect in points.
The default value is 0.0."""
...
@blur.setter
def blur(self, value: float):
...
@property
def distance(self) -> float:
"""Gets or sets a double value that specifies the amount of separation of the reflected image from the object in points.
The default value is 0.0."""
...
@distance.setter
def distance(self, value: float):
...
@property
def size(self) -> float:
"""Gets or sets a double value between 0.0 and 1.0 representing the size of the reflection
as a percentage of the reflected object.
The default value is 0.0."""
...
@size.setter
def size(self, value: float):
...
@property
def transparency(self) -> float:
"""Gets or sets a double value between 0.0 (opaque) and 1.0 (clear) representing the degree
of transparency for the reflection effect.
The default value is 0.0."""
...
@transparency.setter
def transparency(self, value: float):
...
...
Also added new public property to ShapeBase class:
@property
def reflection(self) -> aspose.words.drawing.ReflectionFormat:
"""Gets reflection formatting for the shape."""
...
This use case explains how to work with the reflection of a shape:
import aspose.words as aw
doc = aw.Document("Various shapes.docx")
shape = doc.get_child(aw.NodeType.SHAPE, 0, True).as_shape()
shape.reflection.transparency = 0.37
shape.reflection.size = 0.48
shape.reflection.blur = 17.5
shape.reflection.distance = 9.2
doc.save("Shape.Reflection.docx")
doc = aw.Document("Shape.Reflection.docx")
shape = doc.get_child(aw.NodeType.SHAPE, 0, True).as_shape()
self.assertAlmostEqual(0.37, shape.reflection.transparency, delta=0.01)
self.assertAlmostEqual(0.48, shape.reflection.size, delta=0.01)
self.assertAlmostEqual(17.5, shape.reflection.blur, delta=0.01)
self.assertAlmostEqual(9.2, shape.reflection.distance, delta=0.01)
shape.reflection.remove()
self.assertEqual(0, shape.reflection.transparency)
self.assertEqual(0, shape.reflection.size)
self.assertEqual(0, shape.reflection.blur)
self.assertEqual(0, shape.reflection.distance)
Added a public property setter for Style.LinkedStyleName
A public property setter for linked_style_name has been added to Style class:
@property
def linked_style_name(self) -> str:
"""Gets/sets the name of the :class:`Style` linked to this one. Returns empty string if no styles are linked.
It is only allowed to link the paragraph style to the character style and vice versa.
Setting LinkedStyleName for the current style automatically leads to setting LinkedStyleName for the linked style.
Assigning the empty string is equivalent to unlinking the previously linked style."""
...
@linked_style_name.setter
def linked_style_name(self, value: str):
...
This use case explains how to set LinkedStyleName property of the paragraph and character styles:
import aspose.words as aw
doc = aw.Document()
style_heading1 = doc.styles.get_by_style_identifier(aw.StyleIdentifier.HEADING1)
style_heading_1_char = doc.styles.add(aw.StyleType.CHARACTER, "Heading 1 Char")
style_heading_1_char.font.name = "Verdana"
style_heading_1_char.font.bold = True
style_heading_1_char.font.border.line_style = aw.LineStyle.DOT
style_heading_1_char.font.border.line_width = 15
style_heading1.linked_style_name = "Heading 1 Char"
self.assertEqual("Heading 1 Char", style_heading1.linked_style_name)
self.assertEqual("Heading 1", style_heading_1_char.linked_style_name)
Added new SaveFormat.WebP
Known issues: Animated WebP (VP8X) images are not supported and will be converted to static images.
class SaveFormat(Enum):
"""Indicates the format in which the document is saved."""
...
"""Renders a page of the document and saves it as a WebP file."""
WEB_P: int
...
Added public Format properties to Chart, ChartTitle, ChartAxisTitle and ChartLegend classes
Public format properties of the ChartFormat type have been added to the Chart, ChartTitle, ChartAxisTitle and ChartLegend classes.
@property
def format(self) -> aspose.words.drawing.charts.ChartFormat:
"""Provides access to fill and line formatting of the chart title."""
...
This use case explains how to set background color for chart, chart title, axis title and legend:
import aspose.words as aw
doc = aw.Document()
builder = aw.DocumentBuilder(doc)
shape = builder.insert_chart(chart_type=aw.drawing.charts.ChartType.COLUMN, width=432, height=252)
chart = shape.chart
series = chart.series
series.clear()
categories = ["Category 1", "Category 2"]
series.add(series_name="Series 1", categories=categories, values=[1, 2])
series.add(series_name="Series 2", categories=categories, values=[3, 4])
chart.format.fill.solid(drawing.Color.dark_slate_gray)
chart.axis_x.tick_labels.position = aw.drawing.charts.AxisTickLabelPosition.NONE
chart.axis_y.tick_labels.position = aw.drawing.charts.AxisTickLabelPosition.NONE
chart.title.format.fill.solid(drawing.Color.light_goldenrod_yellow)
chart.axis_x.title.show = True
chart.axis_x.title.format.fill.solid(drawing.Color.light_goldenrod_yellow)
chart.legend.format.fill.solid(drawing.Color.light_goldenrod_yellow)
doc.save("Charts.ChartFormat.docx")
Added public property HtmlLoadOptions.SupportFontFaceRules
A new public property support_font_face_rules has been added to class HtmlLoadOptions:
@property
def support_font_face_rules(self) -> bool:
"""Gets or sets a value indicating whether to support @font-face rules and whether to load declared fonts.
Default value is ``False``.
If this option is enabled, fonts declared in @font-face rules are loaded and embedded into the resulting document's
font definitions (see :attr:`aspose.words.DocumentBase.font_infos`). This makes the loaded fonts available for rendering but
doesn't automatically enable embedding of the fonts upon saving. In order to save the document with loaded fonts,
the :attr:`aspose.words.fonts.FontInfoCollection.embed_true_type_fonts` property of the :attr:`aspose.words.DocumentBase.font_infos`
collection should be set to ``True``.
Supported font formats are TTF, EOT, and WOFF.
@font-face rules are not supported when loading SVG images."""
...
@support_font_face_rules.setter
def support_font_face_rules(self, value: bool):
...
This use case explains how to use support_font_face_rules option:
import aspose.words as aw
load_options = aw.loading.HtmlLoadOptions()
load_options.support_font_face_rules = True
doc = aw.Document("Html with FontFace.html", load_options)
self.assertEqual("Squarish Sans CT Regular", doc.font_infos[0].name)
Added public property ParagraphFormat.mirror_indents
A new public property mirror_indents has been added to class ParagraphFormat:
@property
def mirror_indents(self) -> bool:
"""Gets or sets a flag indicating whether the left and right indents are of the same width."""
...
@mirror_indents.setter
def mirror_indents(self, value: bool):
...
This use case explains how to use mirror_indents:
import aspose.words as aw
doc = aw.Document("Document.docx")
format = doc.first_section.body.paragraphs[0].paragraph_format
format.mirror_indents = True
doc.save("ParagraphFormat.MirrorIndents.docx")
Provided sign document option in SaveOptions
Implemented new public class in aspose.words.saving namespace:
class DigitalSignatureDetails:
"""Contains details for signing a document with a digital signature."""
def __init__(self, certificate_holder: aspose.words.digitalsignatures.CertificateHolder, sign_options: aspose.words.digitalsignatures.SignOptions):
"""Initializes a new instance of :class:`DigitalSignatureDetails` class.
:param certificate_holder: A certificate holder which contains the certificate itself.
:param sign_options: Signature options to use for signing a document."""
...
@property
def certificate_holder(self) -> aspose.words.digitalsignatures.CertificateHolder:
"""Gets or sets a :attr:`DigitalSignatureDetails.certificate_holder` object that contains the certificate used to sign a document."""
...
@certificate_holder.setter
def certificate_holder(self, value: aspose.words.digitalsignatures.CertificateHolder):
...
@property
def sign_options(self) -> aspose.words.digitalsignatures.SignOptions:
"""Gets or sets a :attr:`DigitalSignatureDetails.sign_options` object used to sign a document."""
...
@sign_options.setter
def sign_options(self, value: aspose.words.digitalsignatures.SignOptions):
...
Also added new public property to OoxmlSaveOptions, DocSaveOptions and OdtSaveOptions classes:
@property
def digital_signature_details(self) -> aspose.words.saving.DigitalSignatureDetails:
"""Gets or sets :class:`DigitalSignatureDetails` object used to sign a document."""
...
@digital_signature_details.setter
def digital_signature_details(self, value: aspose.words.saving.DigitalSignatureDetails):
...
This use case explains how to specify signature options while saving document:
import aspose.words as aw
from datetime import datetime
doc = aw.Document("Document.docx")
certificate_holder = aw.digitalsignatures.CertificateHolder.create("morzal.pfx", "aw")
save_options = aw.saving.OoxmlSaveOptions()
sign_options = aw.digitalsignatures.SignOptions()
sign_options.comments = "Some comments"
sign_options.sign_time = datetime.now()
save_options.digital_signature_details = aw.saving.DigitalSignatureDetails(certificate_holder, sign_options)
doc.save("OoxmlSaveOptions.DigitalSignature.docx", save_options)