PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 25
→
Aula 1005 - Relatorio - 40 - Pdf - Ler e Extrair Texto
Aula 1005 - Relatorio - 40 - Pdf - Ler e Extrair Texto
Started by amarildo, Dec., 21 2016 11:19 AM - No answer
Connect yourself…
amarildo
#1
Registered member
535 messages
Popularité : +14 (14 votes)
Posted on December, 21 2016 - 11:19 AM
// Le o Pdf, Extrai Texto , e Adiciona Chave No Conhecimento em Tabela
arquivo_pdf is
string
=
""
// fSelect("", "", "Seleciona Um Arquivo Pdf ... ", "Pdf" + TAB + "*.pdf", "*.pdf")
_imagen_string is
string
=
fImageSelect
(
arquivo_pdf
,
""
,
"Selecione PDF..."
,
"PDF"
+
TAB
+
"*.PDF"
)
_chaves_array is
array of string
n
_procura is
int
=
0
IF
_imagen_string
<
>
""
THEN
IMG_
pdf
=
_imagen_string
n
Paginas is
int
=
0
LOOP
n
Paginas
+
+
s
Pagina_atual is
string
=
n
Paginas
EDT_
pdf_texto
=
PDFToText
(
_imagen_string
,
s
Pagina_atual
)
// extrai texto pg 1
IF
EDT_
pdf_texto
=
""
THEN BREAK
n
Soma is
int
=
0
LOOP
n
Soma
+
+
Message
(
"Pesquisando Pagina do Pdf Numero:"
+
n
Paginas
+
" "
+
CR
+
EDT_
pdf_texto_1
[
[
1
TO
44
]
]
+
CR
+
n
Soma
)
EDT_
pdf_texto_1
=
ExtractString
(
EDT_
pdf_texto
,
n
Soma
,
" "
)
IF
EDT_
pdf_texto_1
[
[
1
TO
2
]
]
=
estado.codigo_uf_ibge
THEN
//
IF EDT_pdf_texto_1[[7 TO 20]]=empresa.cnpj THEN
_chave_ is
string
=
EDT_
pdf_texto_1
[
[
1
TO
44
]
]
IF
_chave_
<
>
""
THEN
n
_procura
=
Seek
(
_chaves_array
,
asLinearFirst
,
_chave_
)
IF
n
_procura
=
-
1
THEN
TableAddLine
(
TABLE_
conhecimento_nfe
)
n
_quantos is
int
=
TABLE_
conhecimento_nfe
..
Occurrence
TABLE_
conhecimento_nfe
[
n
_quantos
]
=
_chave_
END
END
END
IF
EDT_
pdf_texto_1
=
EOT
THEN BREAK
END
END
END
TableDisplay
(
TABLE_
conhecimento_nfe
)
Message
(
)
Info
(
"Fim da Importação do Relatorio com Chaves"
)
http://windevdesenvolvimento.blogspot.com.br/2016/12/aula-1005-relatorio-40-pdf-ler-e.html
Report
0
0
→ Go back to WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text