I am trying to dump a PDF to text using a command line utility (It works with tests from dos command line) from my Delphi code.
Here is my code
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;
When placing breakpoints in code and stepping through, it makes it to the
if fileExists(changeFileExt(fFileName, '.txt')) then
line but returns false, so the Shellexecute was called but no file was ever dumped
What have I done wrong?