VC 命令行打印PDF文件

来源:互联网 发布:怎么用手机淘宝充话费 编辑:程序博客网 时间:2024/05/07 10:05
CString param;param.Format(_T("/t %s"),sFilePath);SHELLEXECUTEINFO ShExecInfoPrintf = {0};ShExecInfoPrintf.cbSize = sizeof(SHELLEXECUTEINFO);ShExecInfoPrintf.fMask = SEE_MASK_NOCLOSEPROCESS;ShExecInfoPrintf.hwnd = NULL;ShExecInfoPrintf.lpVerb = NULL;ShExecInfoPrintf.lpFile = _T("AcroRd32");//此处是待打印的 pdf文档ShExecInfoPrintf.lpParameters = param;ShExecInfoPrintf.lpDirectory = NULL;ShExecInfoPrintf.nShow = SW_HIDE;ShExecInfoPrintf.hInstApp = NULL;ShellExecuteEx(&ShExecInfoPrintf); //可添加 bool变量,判断是否成功。if (WaitForSingleObject(ShExecInfoPrintf.hProcess,5000) == WAIT_TIMEOUT){TerminateProcess(ShExecInfoPrintf.hProcess,0);}


//命令行参数

Option
Meaning
/n
Start a separate instance of Acrobat or Adobe Reader, even if one is currently open.
/s
Suppress the splash screen.
/o
Suppress the open file dialog box.
/h
Start Acrobat or Adobe Reader in a minimized window.


原创粉丝点击