PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 26 → Procedure to Extract text from PDF files with Windev (Procedimento para Extrair texto de arquivos PDF com Windev)
Procedure to Extract text from PDF files with Windev (Procedimento para Extrair texto de arquivos PDF com Windev)
Débuté par adrianoboller, 10 déc. 2014 15:52 - 2 réponses
Membre enregistré
3 274 messages
Popularité : +89 (91 votes)
Posté le 10 décembre 2014 - 15:52
//Procedure to Extract text from PDF files with Windev
//Procedimento para Extrair texto de arquivos PDF com Windev
#########################################################################################

tmpArq is string

tmpArq = fImageSelect(EdtArqPdf,"","Selecione PDF...","PDFs"+TAB+"*.PDF")



IF tmpArq<>"" THEN

EdtArqPdf = tmpArq // mostra o nome do arquivo na tela

ImgPDF = tmpArq // mostra o PDF na tela

StaTextoDoPDF = PDFToText(tmpArq,"1") // extrai texto pg 1

END

#########################################################################################
Membre enregistré
3 274 messages
Popularité : +89 (91 votes)
Posté le 05 mars 2020 - 21:50
PROCEDURE Pdf_Extrair_Txt()

IF YesNo("Total de Número de págs no PDF é de: " + EDT_Pag_Final + ", deseja prosseguir?") THEN

x is int

sTexto is string

LOOP (EDT_Pag_Final)
x++
IF x <= EDT_Pag_Final
sTexto += PDFToText(EDT_Path,""+x+"") + CR
ELSE
BREAK
END
END

fSaveText("c:\temp\extraido.txt",sTexto)

ShellExecute("c:\temp\extraido.txt")

END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Membre enregistré
3 274 messages
Popularité : +89 (91 votes)
Posté le 06 avril 2021 - 13:17
sFichier is string = fSelect("", "", "Selecione uma imagem ou um pdf ...", fGraphicFilter(), ExtractString(ExtractString(fGraphicFilter(), 2, TAB), 1, CR))

IF sFichier <> ""
SetFocus(EDT_Text)
ExtraitTexte(sFichier)
IF StringCount(sFichier,"pdf",IgnoreCase) > 0

x is int = 0

LOOP(10) // 10 páginas
x++
EDT_Text1 += PDFToText(sFichier,""+x+"")
END

END

IF EDT_Text1 = "" THEN

END

END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/