Spaces:
Sleeping
Sleeping
import PyPDF2 | |
def extract_text_from_pdf(pdf_path): | |
# Open the PDF file | |
with open(pdf_path, 'rb') as file: | |
reader = PyPDF2.PdfReader(file) | |
text = '' | |
# Iterate through each page | |
for page in reader.pages: | |
text += page.extract_text() | |
return text | |
pdf_path = 'Examples/Kris.pdf' | |
print(extract_text_from_pdf(pdf_path)) |