MasterPassword Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Specifies a password for the document's access permissions. If the password is an empty string, accessing the document is not restricted. If a password is specified, the access permissions are given through the SaveSettings.DocumentAccessPermissions property.
Syntax
public string MasterPassword { get; set; }Public Property MasterPassword As StringExamples
The following example supplies an owner password obtained from secure application configuration. The configured base settings are then used by the appropriate load or save operation.
loadSaveSettingsBase.MasterPassword = documentPassword;
if (loadSaveSettingsBase is LoadSettings loadSettings)
{
textControl.Load("template.docx", StreamType.WordprocessingML, loadSettings);
}
else if (loadSaveSettingsBase is SaveSettings saveSettings)
{
textControl.Save("configured-document.docx", StreamType.WordprocessingML, saveSettings);
}loadSaveSettingsBase.MasterPassword = documentPassword
If TypeOf loadSaveSettingsBase Is LoadSettings Then
textControl.Load("template.docx", StreamType.WordprocessingML, DirectCast(loadSaveSettingsBase, LoadSettings))
ElseIf TypeOf loadSaveSettingsBase Is SaveSettings Then
textControl.Save("configured-document.docx", StreamType.WordprocessingML, DirectCast(loadSaveSettingsBase, SaveSettings))
End IfLimitations
PDF only. The encryption key length is 128 bits.