示例#1
0
void *StandardSecurityHandler::getAuthData() {
#if HAVE_XPDFCORE
    XPDFCore *core;
    GooString *password;

    if (!(core = (XPDFCore *)doc->getGUIData()) ||
            !(password = core->getPassword())) {
        return NULL;
    }
    return new StandardAuthData(password, password->copy());
#elif HAVE_WINPDFCORE
    WinPDFCore *core;
    GooString *password;

    if (!(core = (WinPDFCore *)doc->getGUIData()) ||
            !(password = core->getPassword())) {
        return NULL;
    }
    return new StandardAuthData(password, password->copy());
#else
    return NULL;
#endif
}