将 Excel 转换为 PowerPoint
Contents
[
Hide
]
Aspose.Cells for Python via Java 支持将 Excel(.xls、xlsx、.xlsb、xlsm)、CSV 和 OpenOffice(.ods)文件转换为 PowerPoint 文件。
将 Excel 工作簿转换为 PPT
无需考虑如何将 Excel 工作簿转换为 PowerPoint,因为 Aspose.Cells for Python via Java 库有最佳决策。 Aspose.Cells for Python via Java API 支持将电子表格转换为 PowerPoint 格式。要将工作簿导出到 PowerPoint,请通过保存格式.PPTX作为第二个参数[工作簿.保存](https://reference.aspose.com/cells/python-java/asposecells.api/workbook#save(java.lang.String,%20int)) 方法。您也可以使用PptxSave选项类以指定将工作表导出到 .pptx 文件的其他设置。
下面的代码示例演示了将 Excel 工作簿导出到 PPT。请看代码转换源文件以代码生成的Word文件作为参考。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jpype | |
import asposecells | |
jpype.startJVM() | |
from asposecells.api import Workbook, SaveFormat | |
# Load Source Excel file | |
workbook = Workbook("sample.xlsx") | |
# Save the workbook as Word format | |
workbook.save("sample_out.pptx", SaveFormat.PPTX) | |
jpype.shutdownJVM() |