FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Lectura del TEXTO desde archivo PDF
Posts: 492
Joined: Wed Nov 16, 2005 12:03 PM
Lectura del TEXTO desde archivo PDF
Posted: Mon Dec 18, 2023 09:12 PM

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.

Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: Lectura del TEXTO desde archivo PDF
Posted: Tue Dec 19, 2023 01:23 AM
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
greeting,

Jimmy
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Lectura del TEXTO desde archivo PDF
Posted: Tue Dec 19, 2023 07:32 AM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Lectura del TEXTO desde archivo PDF
Posted: Tue Dec 19, 2023 02:30 PM
This may not work with complex pdfs but works with simple pdfs
No harm trying
Code (fw): Select all Collapse
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
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion