Untitled
unknown
plain_text
a year ago
630 B
9
Indexable
from PyPDF2 import PdfReader
# Load the PDF file
file_path_1 = "/mnt/data/file-APwp9R0kkeAqhcXrR2vBRQDE"
file_path_2 = "/mnt/data/file-YjZig8WvnSBynSwcA3C82mbv"
file_path_3 = "/mnt/data/file-OK3W5hcJtJVypHne9Xo4E8Kn"
# Function to extract text from a PDF file
def extract_text_from_pdf(file_path):
pdf = PdfReader(file_path)
text = ""
for page in pdf.pages:
text += page.extract_text() + "\n"
return text
# Extract text from the uploaded PDF files
text_1 = extract_text_from_pdf(file_path_1)
text_2 = extract_text_from_pdf(file_path_2)
text_3 = extract_text_from_pdf(file_path_3)
text_1, text_2, text_3Editor is loading...
Leave a Comment