我正在尝试使用我的 Delphi 代码中的命令行实用程序(它适用于 dos 命令行的测试)将 PDF 转储为文本。
这是我的代码
if fileexists(ExtractFilePath(Application.ExeName) + 'pdftotext.exe') then
begin
ShellExecute(H,'open', 'pdftotext.exe', PWideChar(fFileName), nil, SW_SHOWNORMAL);
if fileExists(changeFileExt(fFileName, '.txt')) then
Lines.LoadFromFile(changeFileExt(fFileName, '.txt'))
else
ShowMessage('File Not found');
end;
在代码中放置断点并单步执行时,它会到达
if fileExists(changeFileExt(fFileName, '.txt')) then
行但返回 false,因此调用了 Shellexecute 但没有转储任何文件
我做错了什么?