不带图表加载源Excel文件
Contents
[
Hide
]
Aspose.Cells for Python via .NET 允许你在没有图表的情况下加载 Excel 文件。请使用 LoadOptions.load_filter 属性实现此目的。
加载不带图表的电子表格
以下示例代码加载不带图表的示例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 LoadDataFilterOptions, LoadFilter, LoadOptions, SaveFormat, Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
# Specify the load options and filter the data | |
options = LoadOptions() | |
# Include everything except charts | |
options.load_filter = LoadFilter(LoadDataFilterOptions.ALL & ~LoadDataFilterOptions.CHART) | |
# Load the workbook with specified load options | |
workbook = Workbook(dataDir + "chart.xlsx", options) | |
# Save the workbook in PDF format | |
workbook.save(dataDir + "ResultWithoutChart.pdf", SaveFormat.PDF) |