“Procure uma palavra em pdf usando python” Respostas de código

Procure uma palavra em pdf usando python

import PyPDF2
import re

# Open the pdf file
object = PyPDF2.PdfFileReader(r"C:\TEST.pdf")

# Get number of pages
NumPages = object.getNumPages()

# Enter code here
String = "Enter_the_text_to_Search_here"

# Extract text and do the search
for i in range(0, NumPages):
    PageObj = object.getPage(i)
    Text = PageObj.extractText()
    if re.search(String,Text):
         print("Pattern Found on Page: " + str(i))
Long Llama

Procure uma palavra em pdf usando python

import PyPDF2
import re

# Open the pdf file
object = PyPDF2.PdfFileReader(r"C:\TEST.pdf")

# Get number of pages
NumPages = object.getNumPages()

# Enter code here
String = "Enter_the_text_to_Search_here"

# Extract text and do the search
for i in range(0, NumPages):
    PageObj = object.getPage(i)
    Text = PageObj.extractText()
    if re.search(String,Text):
         print("Pattern Found on Page: " + str(i))
ishwar sangolli

Respostas semelhantes a “Procure uma palavra em pdf usando python”

Perguntas semelhantes a “Procure uma palavra em pdf usando python”

Mais respostas relacionadas para “Procure uma palavra em pdf usando python” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código