Install any skill in seconds. Free to start, no credit card required.
Get Started Free →brycewang-stanford/pdf-extraction-guide
PDF parsing, text extraction, and document format conversion
Passed 18 of 22 test cases with the skill, and 14 of 22 without it.
and 2 more in the full report
4 fixed14 passed either way4 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 4 test cases the skill fixed. Same model, same prompt, with and without the skill.
I am building a document parsing workflow and need Python code to extract both figures and tables from scientific PDFs. Please show how to save extracted page images while converting CMYK graphics to RGB, as well as how to read tables across pages into pandas DataFrames.
| Checked | Without skill | With skill |
|---|---|---|
| CMYK images are checked using pix.n - pix.alpha > 3. | Missed | Passed |
| CMYK image conversion uses fitz.Pixmap(fitz.csRGB, pix). | Passed | Passed |
| Tables are extracted using pdfplumber into pandas DataFrames. | Passed | Passed |
The instructions your model reads when the skill loads.
Extract text, tables, figures, and metadata from academic PDFs using Python libraries, with strategies for handling multi-column layouts, mathematical content, and scanned documents.
| Tool | Text | Tables | Figures | Layout | OCR | Speed |
|---|---|---|---|---|---|---|
| PyMuPDF (fitz) | Excellent | Manual | Yes | Blocks | No (add with OCR engine) | Fast |
| pdfplumber | Good | Excellent | No | Tables focus | No | Medium |
| PyPDF2 / pypdf | Basic | No | No | No | No | Fast |
| Tabula-py | No | Excellent | No | No | No | Medium |
| GROBID | Structured | Yes | References | Academic layout | No | Slow (ML-based) |
| Nougat (Meta) | Excellent | Yes | Yes | Academic layout | Built-in | Slow (GPU) |
| Marker | Excellent | Yes | Yes | Multi-column | Built-in | Medium |
| pdf2image + Tesseract | Via OCR | Via OCR | Via OCR | No | Yes | Slow |
import fitz # pip install PyMuPDF
def extract_text(pdf_path):
"""Extract all text from a PDF with page numbers."""
doc = fitz.open(pdf_path)
full_text = []
for page_num, page in enumerate(doc, 1):
text = page.get_text("text")
full_text.append(f"--- Page {page_num} ---\n{text}")
doc.close()
return "\n".join(full_text)
# Usage
text = extract_text("paper.pdf")
print(text[:2000])
test cases passed, vs 14 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.