Do you check if the security handler is not NULL.
Also, do you check for doc_open permission? Your code should be something similar to this
SecurityHandler s = doc.GetSecurityHandler();
if (s!=null && s.GetPermission(SecurityHandler::e_doc_open)) {
… s.GetPermission(SecurityHandler::e_print)
}
else {
if (doc.InitStdSecurityHandler("my pass ")) {
if (s.GetPermission(SecurityHandler::e_doc_open))
… s.GetPermission(SecurityHandler::e_print)
}
}
If this does not help, could you please send a test project along with a test file to support at pdftron. Than you!