Page 1 of 1

Lectura del TEXTO desde archivo PDF

PostPosted: Mon Dec 18, 2023 9:12 pm
by jnavas
Saludos
Necesitamos leer el contenido del texto de un archivo PDF, necesario para lectura de asientos contables, el usuario desea evitar la transcripciĆ³n de miles de asientos contables.

Re: Lectura del TEXTO desde archivo PDF

PostPosted: Tue Dec 19, 2023 1:23 am
by Jimmy
hi,

as i can say you need to extract TEXT from PDF

there are Tools, like xPDFreader, which can extract TEXT from PDF
https://www.xpdfreader.com/download.html
---
you can use Source of xPDFreader and try to use it direct under harbour

Re: Lectura del TEXTO desde archivo PDF

PostPosted: Tue Dec 19, 2023 7:32 am
by Antonio Linares

Re: Lectura del TEXTO desde archivo PDF

PostPosted: Tue Dec 19, 2023 2:30 pm
by nageswaragunupudi
This may not work with complex pdfs but works with simple pdfs
No harm trying
Code: Select all  Expand view
function pdf2txt( cPdf, cTxt )

   local oWord := WinWordObj()
   local oDoc

   cPdf  := cFileSetExt( cPdf, "pdf" )
   if File( cPdf )
      cPdf  := TrueName( cPdf )
      DEFAULT cTxt := cFileSetExt( cPdf, "txt" )

      oDoc  := oWord:Documents:Open( cPdf )
      oDoc:SaveAs2( cTxt, 2 ) // wdFormatText )
      oDoc:Close()

      FW_MEMOEDIT( cTxt )
   else
      ? cPdf + " not found"
      cTxt  := nil
   endif

return cTxt