docobj saveas(pdffilenamefileformat=wdformatpdfdocobj close(wordobj quit(to write program that produces pdfs with your own contentyou must use the docx module to create word documentthen use the pywin package' win com client module to convert it to pdf replace the code to create word document goes here comment with docx function calls to create your own content for the pdf in word document this may seem like convoluted way to produce pdfsbut as it turns outprofessional software solutions are often just as complicated summary text information isn' just for plaintext filesin factit' pretty likely that you deal with pdfs and word documents much more often you can use the pypdf module to read and write pdf documents unfortunatelyreading text from pdf documents might not always result in perfect translation to string because of the complicated pdf file formatand some pdfs might not be readable at all in these casesyou're out of luck unless future updates to pypdf support additional pdf features word documents are more reliableand you can read them with the python-docx package' docx module you can manipulate text in word documents via paragraph and run objects these objects can also be given stylesthough they must be from the default set of styles or styles already in the document you can add new paragraphsheadingsbreaksand pictures to the documentthough only to the end many of the limitations that come with working with pdfs and word documents are because these formats are meant to be nicely displayed for human readersrather than easy to parse by software the next takes look at two other common formats for storing informationjson and csv files these formats are designed to be used by computersand you'll see that python can work with these formats much more easily practice questions string value of the pdf filename is not passed to the pypdf pdffilereader(function what do you pass to the function insteadwhat modes do the file objects for pdffilereader(and pdffilewriter(need to be opened inhow do you acquire page object for page from pdffilereader objectwhat pdffilereader variable stores the number of pages in the pdf documentif pdffilereader object' pdf is encrypted with the password swordfishwhat must you do before you can obtain page objects from it