I’m using FastAPI to upload PDFs, and I want to parse them with pymupdf4llm.to_markdown to maintain their structure. This worked fine with file paths during local development and testing, but UploadFile gives me bytes (await file.read()), and it seems to_markdown doesn’t accept in-memory files or BytesIO.
Is there a way to use to_markdown without saving the file to disk? I’d like to keep everything in-memory if possible.