How can search a word or a line in a pdf file?
Is t开发者_C百科here an existing module to do that by being concise?
Thank you in advance,
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()
精彩评论