public class LoadOptions extends Object
Allows to specify additional options (such as password) when opening a document to sign.
| Constructor and Description |
|---|
LoadOptions()
Initializes a new instance of LoadOptions class.
|
LoadOptions(FileType fileType)
Initializes a new instance of LoadOptions class with a specified file type.
|
| Modifier and Type | Method and Description |
|---|---|
FileType |
getFileType()
Gets the file type of the document.
|
String |
getPassword()
Gets or sets password to open a protected document.
|
Integer |
getPermissions()
The PDF document permissions such as printing, modification and data extraction.
|
boolean |
getSkipExternalResources()
Gets or sets a flag that tells whether resources stored outside the document are skipped when it is loaded.
|
List<String> |
getWhitelistedResources()
Gets or sets parts of addresses of external resources that may be loaded while
getSkipExternalResources() is true. |
void |
setFileType(FileType value)
Sets the file type of the document, so it is not detected from the document content.
|
void |
setPassword(String value)
Gets or sets password to open a protected document.
|
void |
setPermissions(Integer value)
Internal setter, used by document load processors to record permissions parsed from the file.
|
void |
setSkipExternalResources(boolean value)
Gets or sets a flag that tells whether resources stored outside the document are skipped when it is loaded.
|
void |
setWhitelistedResources(List<String> value)
Gets or sets parts of addresses of external resources that may be loaded while
getSkipExternalResources() is true. |
public LoadOptions()
Initializes a new instance of LoadOptions class.
public LoadOptions(FileType fileType)
Initializes a new instance of LoadOptions class with a specified file type.
fileType - The file type of the document, see setFileType(FileType).public final FileType getFileType()
Gets the file type of the document. When it is FileType.Unknown (the default),
the file type is detected from the document content.
public final String getPassword()
Gets or sets password to open a protected document. It will be also used to save signed document as protected.
public final Integer getPermissions()
The PDF document permissions such as printing, modification and data extraction.
Only for PDF documents. Read-only — populated automatically while loading the document.
The value is a flags combination from Permissions.
public final boolean getSkipExternalResources()
Gets or sets a flag that tells whether resources stored outside the document are skipped when it is loaded. The default value is true.
A document can refer to resources outside it: linked images and INCLUDEPICTURE fields in word processing documents, linked pictures in presentations and spreadsheets, images and style sheets an SVG image refers to. Loading such a resource means requesting the address written in the document. On a server that processes documents from other people that is a server-side request forgery risk, and on an offline installation the request fails or waits for a time-out.
When true, external resources are not loaded, except those whose address contains one of
getWhitelistedResources(). Skipped resources are not drawn in page previews or in documents saved as
images, and image, barcode and QR-code search does not see them. Embedded images are not affected, and
hyperlinks are never followed. The setting also applies to documents inside archives.
public final List<String> getWhitelistedResources()
Gets or sets parts of addresses of external resources that may be loaded while
getSkipExternalResources() is true. An address is loaded when it contains one of them, ignoring case.
Empty values are ignored. The default is an empty list; setting null clears it.
public final void setFileType(FileType value)
Sets the file type of the document, so it is not detected from the document content.
FileType.Unknown (the default) or null detects it.
public final void setPassword(String value)
Gets or sets password to open a protected document. It will be also used to save signed document as protected.
public final void setPermissions(Integer value)
public final void setSkipExternalResources(boolean value)
Gets or sets a flag that tells whether resources stored outside the document are skipped when it is loaded.
The default value is true. See getSkipExternalResources().
public final void setWhitelistedResources(List<String> value)
Gets or sets parts of addresses of external resources that may be loaded while
getSkipExternalResources() is true. See getWhitelistedResources().
Copyright © 2026 GroupDocs. All rights reserved.