Spire.Office for Python 9.7.0 is released

2024-07-30 07:33:23

We are excited to announce the release of Spire.Office for Python 9.7.0. In this version, Spire.PDF for Python supports converting PDF to PPTX and adds new interfaces for encrypting and decrypting PDF documents. Moreover, many known issues are fixed successfully in this version. More details are listed below.

Click the following link to download Spire.Office for Python 9.7.0:

Here is a list of changes made in this release

Spire.PDF for Python

Category ID Description
New feature SPIREPDF-6830 Adds new encryption and decryption interfaces for PDF documents.
# Encryption 
pdfDocument = PdfDocument()
securityPolicy = PdfPasswordSecurityPolicy("123456789", "M123456789")
securityPolicy.EncryptionAlgorithm = PdfEncryptionAlgorithm.AES_128
securityPolicy.DocumentPrivilege = PdfDocumentPrivilege.ForbidAll()
securityPolicy.DocumentPrivilege.AllowPrint = True
pdfDocument.Encrypt(securityPolicy)

pdfMargin = PdfMargins()
unitCvtr = PdfUnitConvertor()
pdfMargin.Left = unitCvtr.ConvertUnits(0, PdfGraphicsUnit.Pixel, PdfGraphicsUnit.Point)
pdfMargin.Right = unitCvtr.ConvertUnits(0,PdfGraphicsUnit.Pixel, PdfGraphicsUnit.Point)
pdfMargin.Top = unitCvtr.ConvertUnits(0, PdfGraphicsUnit.Pixel, PdfGraphicsUnit.Point)
pdfMargin.Bottom = unitCvtr.ConvertUnits(0, PdfGraphicsUnit.Pixel, PdfGraphicsUnit.Point)
pageSize = PdfPageSize.A4()

spirePage = pdfDocument.Pages.Add(pageSize, pdfMargin)
pdfDocument.SaveToFile("1.pdf", FileFormat.PDF)
pdfDocument.Dispose()

# Decryption
pdfDocument = PdfDocument()
pdfDocument.LoadFromFile("input.pdf","123456789")
pdfDocument.Decrypt("M123456789")
pdfDocument.SaveToFile("output.pdf", FileFormat.PDF)
pdfDocument.Dispose()
New feature SPIREPDF-6853 Adds a method to delete images.
pdf = PdfDocument()
pdf.LoadFromFile(inputfile)
page = pdf.Pages[0]
imageHelper = PdfImageHelper()
imageInfos = imageHelper.GetImagesInfo(page)
imageHelper.DeleteImage(imageInfos[0])
pdf.SaveToFile(outputFile, FileFormat.PDF)
pdf.Close()
New feature SPIREPDF-6861 Supports converting PDF documents to PPTX documents.
pdfDocument = PdfDocument()
pdfDocument.LoadFromFile("Sample.pdf")
pdfDocument.SaveToFile("ConvertPDFtoPowerPoint.pptx", FileFormat.PPTX)
Bug SPIREPDF-6511 Fixes the issue that the application threw "Cannot find table 'loca' in the font file" when loading SVG files.
Bug SPIREPDF-6737 Fixes the issue that the hyperlinks became inactive after converting PDF documents to PDF/A documents.
Bug SPIREPDF-6817 Fixes the issue that the red annotations were lost after converting PDF documents to HTML documents.

Spire.Doc for Python

Category ID Description
Bug SPIREDOC-10388
SPIREDOC-10512
SPIREDOC-10552
SPIREDOC-10645
Fixes the issue that "ffi_prep_cif_var failed" exception was thrown when using some features of Spire.Doc on Ubuntu 22.

Spire.Presentation for Python

Category ID Description
Bug SPIREPPT-2433 Fixes the issue that the position of shapes changed after ungrouping them.
Bug SPIREPPT-2444 Fixes the issue that getting custom properties of a document failed.
Bug SPIREPPT-2446 Fixes the issue that added custom properties were displayed incorrectly.

Spire.XLS for Python

Category ID Description
Bug - Fix the issue that errors are reported when running on Ubuntu22.