We're pleased to announce the release of Spire.Office for Python 10.12.0. In the version, the Spire.Doc for Python has optimized and enhanced the API; Spire.XLS for Python supports removing duplicate rows in Excel; Spire.Presentation for Python enhances the conversion from PPTX to PDF; Spire.PDF for Python supports timestamping digital signatures; Spire.Barcode for Python supports Linux ARM platform; Spire.OCR for Python introduces platform adjustments and enhances OCR recognition accuracy.
Moreover, many known issues that occurred when converting, processing and saving Word/Excel/PDF/PowerPoint files have been successfully fixed. More details are listed below.
Here is a list of changes made in this release
Spire.Doc for Python
| Category | ID | Description | |||||||||||||||||||||||||||||||||
| Adjustment | - | Added fine-grained format control capabilities for core document elements such as paragraphs, tables, cells, borders, and styles.
|
|||||||||||||||||||||||||||||||||
| Adjustment | - | Enhanced configuration and operation capabilities for Chart and its sub-objects.
|
|||||||||||||||||||||||||||||||||
| Adjustment | - | Enhanced revision, content control and document comparison features.
|
|||||||||||||||||||||||||||||||||
| Adjustment | - | Enhanced auxiliary functions.
|
|||||||||||||||||||||||||||||||||
| Adjustment | - | Reconstructed list system.
|
|||||||||||||||||||||||||||||||||
| Adjustment | - | Removed some redundant or poorly designed properties and methods to improve the overall consistency of the API. For example,obsolete export methods such as OfficeMath.SaveToImage and SaveImageToStream have been removed. |
Spire.XLS for Python
| Category | ID | Description |
| New feature | SPIREXLS-5883 | Added support for removing duplicated rows in a worksheet.
workbook = Workbook() workbook.LoadFromFile(inputFile) sheet = workbook.Worksheets[0] sheet.RemoveDuplicates() workbook.SaveToFile(outputFile, FileFormat.Version2013) workbook.Dispose() |
| Bug | SPIREXLS-5898 | Fixed the issue where incorrect formulas occurred after calling Range.Move(). |
| Bug | SPIREXLS-5923 | Fixed the issue where chart labels were missing when converting Excel to PDF. |
| Bug | SPIREXLS-5924 | Fixed the issue where output was inconsistent when converting Excel to PDF. |
| Bug | SPIREXLS-5945 | Fixed the issue where chart conversion failed using SaveChartAsImage. |
| Bug | SPIREXLS-5992 | Fixed the issue where formula calculations were incorrect when converting Excel to PDF. |
Spire.Presentation for Python
| Category | ID | Description |
| Bug | SPIREPPT-2905 | Fixed the issue where some text was missing when converting PPTX to PDF. |
| Bug | SPIREPPT-3032 | Fixed the issue where content overlapped when converting PPTX to PDF. |
| Bug | SPIREPPT-3036 | Fixed the issue where table layouts were incorrect after converting PPTX to PDF. |
Spire.PDF for Python
| Category | ID | Description |
| New feature | SPIREPDF-7326 | Added support for timestamping digital signatures.
doc = PdfDocument ()
doc. LoadFromFile (inputFile)
# Create a digital signature
signature = Security_PdfSignature (doc, doc.Pages.get_Item(0), inputFile_pfx,"08100601", "signature")
signature.SignDetailsFont = PdfFont(PdfFontFamily.Courier,8.0)
# Set the bounds of the signature box
signature.Bounds = RectangleF(PointF(90.0, 550.0), SizeF (180.0, 90.0))
# Configure signature appearance and details
signature.NameLabel = "Digitally signed by:Gary"
signature.LocationInfoLabel ="Location:"
signature.LocationInfo = "CN"
signature.ReasonLabel = "Reaseon:"
signature.Reason = "Ensure authenticity"
signature.ContactInfoLabel = "Contact Number:"
signature.ContactInfo = "028-81705109"
# Set document permissions
signature.DocumentPermissions = PdfCertificationFlags.ForbidChanges.value
# Set graphic mode for the signature
signature.GraphicsMode = Security_GraphicMode.SignImageAndSignDetail
# Set the signature image
signature.SignImageSource = PdfImage.FromFile(inputImage)
#When setting “none", the Image and Detail are distributed on both sides, when setting “Stretch", the image extends to the entire signatu
signature.SignImageLayout = SignImageLayout.none
url = "https://freetsa.org/tsr"
signature.ConfigureTimestamp(url)
signature.ConfigureHttpOCSP (None, None)
signature.Certificated = True
doc.SaveToFile(outputFile)
doc.Close()
|
| New feature | - | Added support for configuring text layout options when converting PDF to Excel.
pdf = PdfDocument() pdf.LoadFromFile(inputFile) textOption = XlsxTextLayoutOptions(True, False, False) pdf.ConvertOptions.SetPdfToXlsxOptions(textOption) pdf.SaveToFile(outputFile, FileFormat.XLSX) pdf.Dispose() |
| New feature | - | Added support for configuring line layout options when converting PDF to Excel.
pdf = PdfDocument() pdf.LoadFromFile(inputFile) lineOption = XlsxLineLayoutOptions(False,False,False,False) pdf.ConvertOptions.SetPdfToXlsxOptions(lineOption) pdf.SaveToFile(outputFile, FileFormat.XLSX) pdf.Dispose() |
| New feature | - | Added support for configuring table layout options when converting PDF to Excel.
# Load the PDF document from the specified input file path pdf.LoadFromFile(inputFile) # Set the XlsxSpecialTableLayoutOptions as the conversion options for PDF to XLSX conversion options = XlsxSpecialTableLayoutOptions(False, False, False) # Save the PDF document as an Excel file using the specified format and options pdf.SaveToFile(outputFile, FileFormat.XLSX) |
| New feature | - | Added support for configuring OFD conversion options.
pdf = PdfDocument () pdf. LoadFromFile (inputFile) ofdOptions = OfdOptions() ofdOptions.UseTempFileStorage = True pdf.ConvertOptions.SetPdfToOfdOptions(ofdOptions) pdf.SaveToFile(outputFile,FileFormat.OFD) |
| New feature | - | Added support for ignoring images when converting PDF to Markdown.
# Create an instance of PdfToMarkdownConverter with the input PDF file converter = PdfToMarkdownConverter(inputFile) # Configure the converter to skip processing images in the PDF converter.MarkdownOptions.IgnoreImage = True # Convert the PDF content to Markdown format and save to the output file converter.ConvertToMarkdown(outputFile) |
| New feature | SPIREPDF-7870 | Added support for configuring SVG output width and height when converting PDF to SVG.
converter = PdfToSvgConverter(inputFile) converter.SvgOptions.ScaleX = 1.0 converter.SvgOptions.ScaleY = 1.0 converter.Convert(outputFile) |
| Bug | SPIREPDF-7670 | Fixed an issue where table borders were lost when converting PDF to PPTX. |
| Bug | SPIREPDF-7868 | Fixed an exception thrown when setting cell borders on PdfGrid. |
Spire.Barcode for Python
| Category | ID | Description |
| New feature | - | Upgrades SkiaSharp version to 3.116.1. |
| New feature | - | Adds support for Linux ARM platform. |
Spire.OCR for Python
| Category | ID | Description |
| Adjustment | - | Upgraded SkiaSharp to 3.116.1. |
| Adjustment | - | Added support for the Linux-ARM platform. |
| Adjustment | - | Changed license usage to spire.ocr.LicenseProvider; the common license object was no longer used. |
| Enhancement | SPIREOCR-111 | Enhanced error handling: when the system library libdl.so was unavailable, image scanning returned a clear error message. |
| Enhancement | - | Enhanced OCR recognition capability:
1. Supported recognition of rotated images. configureOptions.AutoRotate = True 2. Supported outputting recognized text in the order of its original positions on the image. visualText = VisualTextAligner(scanner.Text)text = visualText.ToString() |