the following into the interactive shellimport pypdf pdffileobj open('meetingminutes pdf''rb'pdfreader pypdf pdffilereader(pdffileobjpdfreader numpages pageobj pdfreader getpage( pageobj extracttext('ooffffiicciiaall bbooaarrdd mmiinnuutteess meeting of march \ the board of elementary and secondary education shall provide leadership and create policies for education that expand opportunities for childrenempower families and communitiesand advance louisiana in an increasingly competitive global market board of elementary and secondary education pdffileobj close(firstimport the pypdf module then open meetingminutes pdf in read binary mode and store it in pdffileobj to get pdffilereader object that represents this pdfcall pypdf pdffilereader(and pass it pdffileobj store this pdffilereader object in pdfreader the total number of pages in the document is stored in the numpages attribute of pdffilereader object the example pdf has pagesbut let' extract text from only the first page to extract text from pageyou need to get page objectwhich represents single page of pdffrom pdffilereader object you can get page object by calling the getpage(method on pdffilereader object and passing it the page number of the page you're interested in--in our case pypdf uses zero-based index for getting pagesthe first page is page the second is page and so on this is always the caseeven if pages are numbered differently within the document for examplesay your pdf is three-page excerpt from longer reportand its pages are numbered and to get the first page of this documentyou would want to call pdfreader getpage( )not getpage( or getpage( once you have your page objectcall its extracttext(method to return string of the page' text the text extraction isn' perfectthe text charles "chasroemerpresident from the pdf is absent from the string returned by extracttext()and the spacing is sometimes off stillthis approximation of the pdf text content may be good enough for your program decrypting pdfs some pdf documents have an encryption feature that will keep them from being read until whoever is opening the document provides password enter the following into the interactive shell with the pdf you downloadedwhich has been encrypted with the password rosebudimport pypdf pdfreader pypdf pdffilereader(open('encrypted pdf''rb')working with pdf and word documents