We can't read a pdf file line to line. These modules read the pages at once. However, one can split it using the split method. One needs to use the following line of code after reading the page of the pdf file. text = pageObj.extractText().split(" ") # Finally the lines are stored into list # For iterating over list a loop is used for i in range(len(text)): print(text[i],end="\
\
")