文档处理pdf
Extract text from PDF documents
axoviq.com · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add axoviq-ai/synthadoc --skill pdf技能说明
name: pdf version: "1.0" description: Extract text from PDF documents entry: script: scripts/main.py class: PdfSkill triggers: extensions: - ".pdf" intents: - "pdf" - "research paper" requires:
- pypdf
- pdfminer.six author: axoviq.com license: AGPL-3.0-or-later
PDF Skill
Extracts text from PDF files using pypdf as the primary parser, with
pdfminer.six as a fallback for CJK fonts that pypdf cannot decode
(detected when pypdf yields fewer than 50 characters per page on average).
Setup
pip install pypdf pdfminer.six
Standalone usage
import asyncio
from synthadoc.skills.pdf.scripts.main import PdfSkill
skill = PdfSkill()
async def main():
result = await skill.extract("/path/to/paper.pdf")
print(result.text) # extracted text from all pages
print(result.metadata) # {"pages": N, "cjk_fallback": bool, ...}
asyncio.run(main())
When this skill is used
- Source path ends with
.pdf - User intent contains:
pdf,research paper
Scripts
scripts/main.py—PdfSkillclass
References
references/cjk-notes.md— notes on CJK font handling