Reputation: 43
How can search a word or a line in a pdf file?
Is there an existing module to do that by being concise?
Thank you in advance,
Upvotes: 2
Views: 287
Reputation: 46395
There's something called as pyPDF.
It is a Pure-Python
library built as a PDF toolkit.
You can extract ( using extractText()
method ) & also perform search on the pdf file with using something like following code.
pdf = pyPdf.PdfFileReader(file(path, "rb"))
content = pdf.getPage(1).extractText()
Upvotes: 3