Ver Mensaje Individual
  #6  
Antiguo 26-12-2019
terb terb is offline
Registrado
 
Registrado: may 2006
Posts: 4
Reputación: 0
terb Va por buen camino
Primero de todo gracias por contestar.

He probado los componentes de Gnostice concretamente el ejemplo que instala en C:\Users\XXX\Documents\Gnostice\Document Studio Delphi\Demos\Delphi\FMX\1. Document Viewer
Y lo he modificado para usar el TgtDocumentConverter y convertir un Pdf a texto pero no se por qué no funciona / no crea ningún archivo .txt y tampoco da ninguna excepción:

Código:
procedure TForm1.lbFilesChange(Sender: TObject);
var
sFileName:string;
DateTimeNow: TDateTime;
DateTimeFile:string;
sPath:string;
sGetDownloadsPath:string;
sException:string;
begin
  try
    try
      lbFiles.Visible := False;
      // Enable buttons back for Mobile
      ActionFileLoad.Enabled := True;

      //Add
      FFileName := FDocDir + PathDelim + lbFiles.Items[lbFiles.ItemIndex];
      DateTimeNow :=  Now;
      DateTimeFile := FormatDateTime('dd_mm_yy_hh_nn_ss',DateTimeNow);
      sFileName := 'demo'+DateTimeFile+'.txt';
      gtDocumentConverter1.InputDocuments.AddDocument(FFileName,'');
      sGetDownloadsPath := TPath.Combine(TPath.GetDownloadsPath,'');
      gtDocumentConverter1.ConvertToFile('.txt',True,True,sGetDownloadsPath, sFileName);
      ShowMessage('Conversion completed');
      //End Add
      DocViewer.LoadFromFile(FFileName);
    except on E: Exception do
      sException:=E.Message;
    end;
  finally
  end;
end;
He visto la funcionalidad de esta clase esta en VCL pero no la veo para FMX. En este link:
gnostice.com/docs/xtremedocumentstudio_delphi/frames.html?frmname=topic&frmfile=vcl_gtxDocumentConverter_TgtDocumentConverter.html

Entonces…
Me surge otra duda … es posible ejecutar un programa java de consola desde Delphi?
Porque la funcionalidad de extraer texto de un Pdf creo recordar que era posible hacerla en Java.

Buenas fiestas y gracias.
Responder Con Cita