[原][工具][C++]调用adobe reader打开pdf,通过命令行启动pdf

百度网盘: adobe reader 11

命令行:

AdobeReaderXIPortable.exe D:\XXX.pdf

 通过C++在windows下打开pdf:

    PROCESS_INFORMATION processInfo;
    STARTUPINFO startupInfo;
    ::ZeroMemory(&startupInfo, sizeof(startupInfo));
    startupInfo.cb = sizeof(startupInfo);
    QString fileName = QString::fromLocal8Bit("xxx.pdf");
    fileName = QString::fromLocal8Bit("E:/软件/adobe_reader11/AdobeReaderXIPortable.exe ") + fileName;
    std::string _file = fileName.toLocal8Bit();
    CreateProcess(NULL, (CHAR*)_file.c_str(),
        NULL,  // process security
        NULL,  // thread security
        FALSE, // no inheritance
        0,     // no startup flags
        NULL,  // no special environment
        NULL,  // default startup directory
        &startupInfo,
        &processInfo);

 

posted @ 2020-02-05 15:31  南水之源  阅读(1187)  评论(0编辑  收藏  举报