user653861
user653861

Reputation: 43

pdf file with python

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

Answers (1)

Saurabh Gokhale
Saurabh Gokhale

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

Related Questions