<jupyter_start><jupyter_text>import PyPDF2 Open the PDF file in read, binary mode PyPDF2.PdfFileReader num_Pages getPage extractText Add pages    addPage    write     get the text of all pages using for loop<jupyter_code>import PyPDF2
f = open('Working_Business_Proposal.pdf','rb')
pdf_reader = PyPDF2.PdfFileReader(f)
pdf_reader.numPages
page_num = pdf_reader.getPage(0)
data = page_num.extractText()
data
print(data)
full_data = []

for page in range(pdf_reader.numPages):
    page_num = pdf_reader.getPage(page)
    data = page_num.extractText()
    full_data.append(data)
print(full_data[1])
f = open('Working_Business_Proposal.pdf','rb')
pdf_reader = PyPDF2.PdfFileReader(f)
first_page = pdf_reader.getPage(0)
type(first_page)
pdf_writer = PyPDF2.PdfFileWriter()
pdf_writer.addPage(first_page)
for i in range(pdf_reader.numPages):
    page = pdf_reader.getPage(i)
    pdf_writer.addPage(page)
new = open('new_file2.pdf','wb')
pdf_writer.write(new)
new.close()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11066398390342053, 'fraction_numerical': 0.01006036217303823, 'mean_word_length': 6.262773722627737, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '399506', 'license': 'Apache-2.0', 'n_tokens_mistral': 368, 'n_tokens_neox': 363, 'n_words': 71, 'path': 'docs/Notebooks/22.pdf-files.ipynb', 'repo_name': 'BhavyaSree/PythonClass', 'size': '994'}