Spire.PDF for Python 10.7.1 supports converting PDF to PPTX

2024-07-09 08:35:58

We're pleased to announce the release of Spire.PDF for Python 10.7.1. This version supports converting PDF documents to PPTX documents, and also adds new encryption and decryption interfaces for PDF documents. In addition, some issues that occurred when converting PDF to PDF/A and HTML have been successfully fixed. More details are listed below.

Here is a list of changes made in this release

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.
Click the link to download Spire.PDF for Python 10.7.1: