Python developers working on Windows 32-bit architecture can utilize the new features and improvements in Aspose.Words for Python via .NET 24.4.0 to empower their Python document processing applications.
This update to the Python Word document API introduces WEBP image format support with the addition of the SaveFormat.WebP
enum member, allowing you to save the Word documents as static WEBP images seamlessly.
Improved Chart API
Many new features are added to the Chart API in Aspose.Words for Python via .NET 24.4.0, enabling greater customization. It lets you control the appearance of various chart elements, including the chart title and legend. This Python code example demonstrates applying the background colors for different chart elements:
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")
Source*
Insert Digital Signature into Word Documents
With the addition of a new feature in this update, you can specify the signing options while saving documents and add digital signatures with comments and timestamps in Word documents on Windows x32 machines, as highlighted in the following Python code example:
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)
Source*
Add Glow and Reflection Effects to Shapes
Using version 24.4.0, developers can apply glow and reflection effects to drawing objects within the Python Word documents. This helps enhance the visual appeal and create more dynamic objects. Please check the Python code example shared below to learn how to manipulate the glow effect 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)
Source*
Embed Fonts Effortlessly
This update to the Python API allows embedding fonts declared within @font-face rules when loading HTML documents on Windows x32 systems. This ensures consistent font rendering within the resulting Word document, as showcased in this Python code example:
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)
Source*
You can view the list of all new features, enhancements, and bug fixes introduced in this release by visiting Aspose.Words for Python via .NET 24.4.0 Release Notes.