LoadOptions class
Leave feedback
On this page
Allows a developer to specify additional options (such as a password) when loading a file.
Learn more
- Load from a local disk
- Load from a stream
- Load a file of a specific format
- Load a password-protected document
The LoadOptions type exposes the following members:
| Constructor | Description |
|---|---|
| init | Initializes a new instance of the LoadOptions class. |
| init | Initializes a new instance of the LoadOptions class. |
| Property | Description |
|---|---|
| file_format | The exact type of the file that is to be loaded. |
| password | The password for opening an encrypted document. |
from groupdocs.metadata import Metadata
from groupdocs.metadata.options import LoadOptions
def load_password_protected_document():
# Specify the password
load_options = LoadOptions()
load_options.password = "123"
with Metadata("protected.docx", load_options) as metadata:
print(f"Opened protected {metadata.file_format} document")
from groupdocs.metadata import Metadata
from groupdocs.metadata.common import FileFormat
from groupdocs.metadata.options import LoadOptions
def loading_file_of_specific_format():
load_options = LoadOptions(FileFormat.SPREADSHEET)
with Metadata("input.xlsx", load_options) as metadata:
root = metadata.get_root_package()
print(f"Author: {root.document_properties.author}")
- module
groupdocs.metadata.options
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.