How can I directly specify a password for a secured PDF document?


We are working on a requirement to open a secured pdf document by
supplying the correct password without throwing any "Password Dialog".
We are making call into
InitSecurityHandler() of PDFDoc object which throws the Password Entry
Dialog. Please let us know, how to supply the password without this

Please also let us know how to validate against the previously set
"Document Open Password" and "Master Password" for the secured pdf
document in case the user decide to change the "Master and/or Document
Open Password".
You may want to take a look at PDFViewSimple (
net/samplecode/PDFViewSimple.cs) for an alternative way to process
secured PDF documents.

Basically instead of calling pdfdoc.InitSecurityHandler() you can
supply the password directly using pdfdoc.InitStdSecurityHandler("My

I am not completely clear regarding your question about password
validation. InitStdSecurityHandler will return true if the supplied
password is correct and will return false otherwise.