How to open a pdf in viewer which have an password

How to open a pdf in viewer which have an password

@VikashVerma551

To load password-protected document specify a password in load options

// Specify a password.
LoadOptions loadOptions = new LoadOptions();
loadOptions.Password = "123456";
// Render a file.
using (Viewer viewer = new Viewer("encrypted.docx", loadOptions))
{
    HtmlViewOptions viewOptions = HtmlViewOptions.ForEmbeddedResources();
    viewer.View(viewOptions);
}

The same example can be also found in the Load password-protected documents documentation article.

Thanks for the same.It worked

1 Like

@VikashVerma551

You’re welcome!