ODSファイルの暗号化と複合化
Contents
[
Hide
]
OpenOffice.orgはパスワード保護とファイルの暗号化をサポートする完全な機能を備えたオフィススイートです。ただし、暗号化されたODSファイルはパスワードを提供した後にのみOpenOfficeで開くことができ、Excelは暗号化されたODSファイルを開くことはできません。暗号化オプションは、その他のファイルタイプとは異なり、ODSファイルには適用されません。
Aspose.Cells for Python via .NETは、ODSファイルの暗号化と復号化を可能にします。復号化されたODSファイルはExcelやOpenOfficeの両方で開くことができます。
OpenOffice Calcで暗号化
- 「名前を付けて保存」を選択し、「パスワードで保存」ボックスをクリックします。
- 保存ボタンをクリックします。
- 開いた「パスワードの設定」ウィンドウの「開くためのパスワードを入力」および「パスワードを確認」フィールドに希望するパスワードを入力します。
- ファイルを保存するために OK ボタンをクリックします。
ODSファイルの暗号化(暗号化とパスワード保護)にAspose.Cells for Python via .NETを使用します。
ODSファイルを暗号化するには、ファイルを読み込んで保存する前にWorkbookSettings.passwordの値を実際のパスワードに設定します。出力される暗号化されたODSファイルは、OpenOfficeでのみ開くことができます。
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 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. | |
sourceDir = RunExamples.Get_SourceDirectory() | |
# Output directory | |
outputDir = RunExamples.Get_OutputDirectory() | |
# Open an ODS file | |
workbook = Workbook(sourceDir + "sampleODSFile.ods") | |
# Password protect the file | |
workbook.settings.password = "1234" | |
# Save the ODS file | |
workbook.save(outputDir + "outputEncryptedODSFile.ods") |
Aspose.Cells for Python via .NETを使って、強力な暗号化タイプのExcelファイルを暗号化し、パスワード保護することも可能です。
ODSファイルを復号化するには、LoadOptions.passwordによるパスワードの提供でファイルを読み込みます。ファイルが読み込まれたら、WorkbookSettings.password文字列をnullに設定します。
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 LoadFormat, LoadOptions, 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. | |
sourceDir = RunExamples.Get_SourceDirectory() | |
# Output directory | |
outputDir = RunExamples.Get_OutputDirectory() | |
# Open an encrypted ODS file | |
loadOptions = LoadOptions(LoadFormat.ODS) | |
# Set original password | |
loadOptions.password = "1234" | |
# Load the encrypted ODS file with the appropriate load options | |
workbook = Workbook(sourceDir + "sampleEncryptedODSFile.ods", loadOptions) | |
# Set the password to null | |
workbook.settings.password = None | |
# Save the decrypted ODS file | |
workbook.save(outputDir + "outputDecryptedODSFile.ods") |