Get Started with PyMuPDF
Install with one simple command.
Quick Examples
12345678
import pymupdf
doc = pymupdf.open("input.pdf") # open the document
md = doc.to_markdown() # convert to markdown
print(md) # print the markdown text
# Optionally, save the markdown text to a file
with open("output.md", "w", encoding="utf-8") as f:
f.write(md)