Python: how to load all pages of the pdf file

I'm working with the code to summarize the text using BERT. I am stopped at the step "loading all pages of the pdf file to the program". My code below just loads only one page. Please help for the instruction. I am a new coder.

f= open('/content/Example.pdf', 'rb')
pdf = PdfFileReader(f)
page = pdf.getPage(6)
text = page.extractText()