Spaces:
Runtime error
Runtime error
File size: 430 Bytes
90aedff |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import fitz # PyMuPDF
import gradio as gr
def extract_text_from_pdf(pdf_file):
doc = fitz.open(stream=pdf_file.read(), filetype="pdf")
text = ""
for page in doc:
text += page.get_text()
return text[:3000] # Show only the first 3000 characters for now
gr.Interface(
fn=extract_text_from_pdf,
inputs=gr.File(file_types=[".pdf"]),
outputs="text",
title="📄 JEE PDF Extractor"
).launch()
|