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()