The encryption protects data and allows only authorized people to open the file. When a file is encrypted, the password must be specified to open the file. To learn how to identify the encrypted file, please refer to the Check if a file is encrypted page.
To load and render an encrypted document, follow these steps:
The following code snippet shows how to load and render an encrypted document:
usingGroupDocs.Viewer;usingGroupDocs.Viewer.Options;// ...// Specify a password.LoadOptionsloadOptions=newLoadOptions();loadOptions.Password="123456";// Render a file.using(Viewerviewer=newViewer("encrypted.docx",loadOptions)){HtmlViewOptionsviewOptions=HtmlViewOptions.ForEmbeddedResources();viewer.View(viewOptions);}
ImportsGroupDocs.ViewerImportsGroupDocs.Viewer.Options' ...
ModuleProgramSubMain(argsAsString())' Specify a password.
DimloadOptionsAsLoadOptions=NewLoadOptions()loadOptions.Password="123456"' Render a file.
UsingviewerAsViewer=NewViewer("encrypted.docx",loadOptions)DimviewOptionsAsHtmlViewOptions=HtmlViewOptions.ForEmbeddedResources()viewer.View(viewOptions)EndUsingEndSubEndModule
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.