Einzelnen Beitrag anzeigen

Benutzerbild von erich.wanker
erich.wanker

Registriert seit: 31. Jan 2008
Ort: im schönen Salzburger Land
460 Beiträge
 
Delphi XE4 Professional
 
#7

AW: PDF .. Text extrahieren

  Alt 18. Feb 2017, 18:29
Hallo Leute ..

********** VIELEN DANK **************

Hab einen Test erfolgreich zum laufen gebracht ... SCHAUT IM MOMENT SEHR GUT AUS







Installiert:
tesseract-ocr-setup-4.00.00dev.exe
gs920w32.exe

Delphi:

Code:
RunProcess('C:\Server\htdocs\files\ghostscript\bin\gswin32c.exe -dNOPAUSE -sDEVICE=tiffg4 -r600x600 -dBATCH -sPAPERSIZE=a4 -sOutputFile='+tiffname+'Image-%d.tiff '+destname , SW_MINIMIZE, true, ProcID);


Code:
RunProcess('C:\Server\htdocs\files\tesseract\tesseract.exe '+tiffname+'Image-1.tiff '+tiffname+'Image-1 -l deu' , SW_MINIMIZE, false, ProcID);




Code:

function TS_ADMIN.RunProcess(FileName: string; ShowCmd: DWORD; wait: Boolean; ProcID: PCardinal): Longword;
var
  StartupInfo: TStartupInfo;
  ProcessInfo: TProcessInformation;
begin
  FillChar(StartupInfo, SizeOf(StartupInfo), #0);
  StartupInfo.cb := SizeOf(StartupInfo);
  StartupInfo.dwFlags := STARTF_USESHOWWINDOW or STARTF_FORCEONFEEDBACK;
  StartupInfo.wShowWindow := ShowCmd;
  if not CreateProcess(nil,
    @Filename[1],
    nil,
    nil,
    False,
    CREATE_NEW_CONSOLE or
    NORMAL_PRIORITY_CLASS,
    nil,
    nil,
    StartupInfo,
    ProcessInfo)
    then
      Result := WAIT_FAILED
  else
  begin
    try
      if not wait then
      begin
        if ProcID <> nil then ProcID^ := ProcessInfo.dwProcessId;
        Result := S_OK;
        exit;
      end;
      WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
      GetExitCodeProcess(ProcessInfo.hProcess, Result);
    finally
      CloseHandle(ProcessInfo.hProcess);
      CloseHandle(ProcessInfo.hThread);
    end;
  end;
end;
Erich Wanker - for life:=1971 to lebensende do begin ..
O
/H\
/ \
  Mit Zitat antworten Zitat