ODS Datei in den ODF 1.1 und 1.2 Spezifikationen speichern
Contents
[
Hide
]
Aspose.Cells für Python via .NET unterstützt das Speichern einer ODS-Datei (OpenDocument Spreadsheet) gemäß den ODF (OpenDocument Format) 1.1 und 1.2-Spezifikationen. Aspose.Cells für Python via .NET verfügt über die Eigenschaft OdsSaveOptions.is_strict_schema11, die die Verwendung der ODF 1.1-Spezifikation zum Speichern von ODS-Dateien angibt. Der Standardwert dieser Eigenschaft ist false, sodass die ODS-Datei ohne diese Einstellung die 1.2-Spezifikationen verwendet.
Das nachfolgende Beispielcode erstellt ein Arbeitsmappenobjekt, fügt einen Wert zur Zelle A1 auf dem ersten Arbeitsblatt hinzu und speichert dann die ODS-Datei in den ODF 1.1- und 1.2-Spezifikationen. Standardmäßig wird die ODS-Datei in der ODF 1.2-Spezifikation gespeichert.
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
from aspose.cells import OdsSaveOptions, 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(".") | |
# Create workbook | |
workbook = Workbook() | |
# Access first worksheet | |
worksheet = workbook.worksheets[0] | |
# Put some value in cell A1 | |
cell = worksheet.cells.get("A1") | |
cell.put_value("Welcome to Aspose!") | |
# Save ODS in ODF 1.2 version which is default | |
options = OdsSaveOptions() | |
workbook.save(dataDir + "ODF1.2_out.ods", options) | |
# Save ODS in ODF 1.1 version | |
options.is_strict_schema11 = True | |
workbook.save(dataDir + "ODF1.1_out.ods", options) |