pdf-analysis
PDF 文档解析。自动区分文字型 PDF 与扫描型 PDF,覆盖:文本/表格提取、多页全量扫描、嵌入图表 caption、单位感知数值计算。
npx skills add OpenSenseNova/SenseNova-Skills --skill pdf-analysis --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# PDF Analysis ## Step 0 — Detect PDF type (text vs scanned) **Critical first step**: determine whether the PDF has extractable text or is a scanned image. Never skip this — using the wrong parser wastes time and produces empty results. ```python import fitz # PyMuPDF def detect_pdf_type(pdf_path, sample_pages=3): """ Returns 'text' if PDF has extractable text, 'scanned' if image-based. Checks first N pages (or all if fewer). """ doc = fitz.open(pdf_path) total_chars = 0 pages_checked = min(sample_pages, len(doc)) for i in range(pages_checked): page = doc[i] text = page.get_text("text") total_chars += len(text.strip()) doc.close() avg_chars = total_chars / max(pages_checked, 1) pdf_type = 'text' if avg_chars > 50 else 'scanned' print(f"PDF type: {pdf_type} (avg {avg_chars:.0f} chars/page, checked {pages_checked} pages)") return pdf_type ``` --- ## Core Method 1: Text PDF — Full Text Extraction (ALL pages) ```python import fitz def extract_text_pdf(pdf_path): """Extract text from all pages of a text-based PDF.""" doc = fitz.open(pdf_path) total_pages = len(doc) print(f"Total pages: {total_pages}") all_text = [] for i, page in enumerate(doc): text = page.get_text("text").strip() if t
- Step 0 — Detect PDF type (text vs scanned)
- Core Method 1: Text PDF — Full Text Extraction (ALL pages)
- Core Method 2: Text PDF — Table Extraction
- Core Method 3: Scanned PDF — OCR via Caption
- Core Method 4: Hybrid PDF (mixed text + image pages)
- Core Method 5: Extract Embedded Images / Charts from PDF
- Common Patterns
- Multi-invoice / multi-document PDF (发票汇总)
- Numeric extraction with unit awareness
- Long document keyword search
- Pitfalls
What does the pdf-analysis skill do?
PDF 文档解析。自动区分文字型 PDF 与扫描型 PDF,覆盖:文本/表格提取、多页全量扫描、嵌入图表 caption、单位感知数值计算。
How do I install it?
Run `npx skills add OpenSenseNova/SenseNova-Skills --skill pdf-analysis --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From OpenSenseNova/SenseNova-Skills, a repository with 4,911 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
