LoadOptions class
Leave feedback
On this page
The options used to open a file.
The LoadOptions type exposes the following members:
| Constructor | Description |
|---|---|
| init | Initializes an instance of the LoadOptions class. |
| init | Initializes a new LoadOptions instance. |
| Property | Description |
|---|---|
| detect_encoding | The property enables encoding detection for FileType.txt, FileType.csv, and FileType.tsv files. |
| encoding | The encoding used when opening text-based files or email messages such as FileType.csv, FileType.txt, and FileType.msg. Default value is utf-8. |
| file_type | The type of the file to open. |
| password | The password to open an encrypted file. |
| resource_loading_timeout | The timeout to load external resources. |
| skip_external_resources | The property disables loading of all external resources such as images, except those listed in LoadOptions.whitelisted_resources. |
| try_repair | The property enables GroupDocs.Viewer to attempt repairing structural corruption in PDF documents. Default is False. |
| whitelisted_resources | The list of URL fragments corresponding to external resources that should be loaded when LoadOptions.skip_external_resources is set to True. |
from groupdocs.viewer import Viewer
from groupdocs.viewer.options import HtmlViewOptions, LoadOptions
load_options = LoadOptions()
load_options.password = "12345"
with Viewer("protected.docx", load_options) as viewer:
viewer.view(HtmlViewOptions.for_embedded_resources("page_{0}.html"))
- module
groupdocs.viewer.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.