LoadOptions class
LoadOptions class
Allows to specify additional options (such as password) when opening a document to annotate.
The LoadOptions type exposes the following members:
Constructors
| Constructor | Description |
|---|---|
| init |
Properties
| Property | Description |
|---|---|
| font_directories | The list of font directories to load custom fonts from. |
| password | The document password. |
| version | The version of the document to load. Default is the latest version. |
Example
from groupdocs.annotation import Annotator
from groupdocs.annotation.options import LoadOptions
from groupdocs.annotation.models import Rectangle
from groupdocs.annotation.models.annotation_models import AreaAnnotation
from groupdocs.pydrawing import Color
def load_password_protected_document():
# Provide the password through LoadOptions
load_options = LoadOptions()
load_options.password = "secret"
with Annotator("./protected.docx", load_options=load_options) as annotator:
area = AreaAnnotation()
area.box = Rectangle(100, 100, 100, 100)
area.background_color = Color.yellow.to_argb()
area.page_number = 0
area.message = "Annotated a password-protected document"
annotator.add(area)
annotator.save("./output.docx")
Guides
Task guides that use LoadOptions:
See Also
- module
groupdocs.annotation.options