在将 Excel 渲染为 PDF 时绘制分析器
Contents
[
Hide
]
如何使用Aspose.Cells for Python Excel库在将Excel渲染为PDF时绘制切片器
如果您有应用切片器的Excel文件,并且想要将Excel以切片器设置导出为PDF,Aspose.Cells for Python via .NET现在默认支持此功能。您只需将带有切片器的Excel文件导出为PDF,生成的PDF将显示已应用切片器。
以下示例代码加载了包含现有切片器的sample Excel file。然后将工作簿保存为output PDF file。以下截图比较了源Excel文件和生成的PDF文件。
示例代码
This file contains hidden or 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
from aspose.cells import SaveFormat, Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
workbook = Workbook(sourceDir + "SampleSlicerChart.xlsx") | |
workbook.save(outputDir + "SampleSlicerChart.pdf", SaveFormat.PDF) |