用createprocess,shellexecute不太好
function TFrmPrintServer.pdfTojpg(fName : string) : boolean;
var
StartupInfo:TStartupInfo;
ProcessInfo:TProcessInformation;
bRes : Boolean;
begin
// 初始化工作
FillChar(StartupInfo,Sizeof(StartupInfo),#0);
StartupInfo.cb := Sizeof(StartupInfo);
StartupInfo.dwFlags := STARTF_USESHOWWINDOW;
bRes := CreateProcess(nil,'.\pdfimages.exe -j .\pdftemp\temp.pdf .\jpgtemp\frompro', nil, nil, false, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS,
nil, nil, StartupInfo, ProcessInfo);
if not bRes then
begin
//showmessage('failed create process!');
result := false;
end
else
begin
WaitForSingleObject(Processinfo.hProcess, INFINITE);
result := true;
//showmessage('process quit!');
end;
end;
本文详细介绍了如何通过使用CreateProcess和Shellexecute函数实现PDF到JPEG转换,提供了代码示例并讨论了其优势。

1234

被折叠的 条评论
为什么被折叠?



