← 返回
效率工具 中文

Document Handler

Read, extract text and metadata, and convert documents in formats like PDF, DOCX, XLSX, PPTX, EPUB, RTF, and OpenDocument.
读取、提取文本和元数据,并转换PDF、DOCX、XLSX、PPTX、EPUB、RTF及OpenDocument等格式文档。
neckr0ik
效率工具 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 843
下载
💾 125
安装
1
版本
#latest

概述

Document Handler

Extract text, metadata, and content from any document format.

Supported Formats

FormatExtensionsText ExtractMetadataConvert
-----------------------------------------------------
PDF.pdf✅ pdftotext✅ pdfinfo✅ pdftoppm
Word.docx✅ unzip + xml
Excel.xlsx✅ unzip + xml
PowerPoint.pptx✅ unzip + xml
EPUB.epub✅ unzip + html
RTF.rtf✅ textutil
OpenDocument.odt, .ods, .odp✅ unzip + xml

Quick Commands

PDF

# Extract text
pdftotext -layout input.pdf output.txt

# Get metadata
pdfinfo input.pdf

# Convert to images (for OCR or viewing)
pdftoppm -png input.pdf output_prefix

# Extract specific pages
pdftotext -f 5 -l 10 -layout input.pdf output.txt

DOCX/XLSX/PPTX (Office Open XML)

# Extract text from DOCX
unzip -p input.docx word/document.xml | sed 's/<[^>]*>//g' | tr -s ' \n'

# Extract text from XLSX (all sheets)
unzip -p input.xlsx xl/sharedStrings.xml | sed 's/<[^>]*>//g' | tr -s '\n'

# Extract text from PPTX
unzip -p input.pptx ppt/slides/*.xml | sed 's/<[^>]*>//g' | tr -s ' \n'

# Get metadata
unzip -p input.docx docProps/core.xml

RTF (macOS)

# Convert RTF to plain text
textutil -convert txt input.rtf -output output.txt

# Convert RTF to HTML
textutil -convert html input.rtf -output output.html

EPUB

# Extract and read EPUB content
unzip -l input.epub                    # List contents
unzip -p input.epub "*.html" | lynx -stdin -dump  # Text via lynx
unzip -p input.epub "*.xhtml" | sed 's/<[^>]*>//g'  # Raw text

OpenDocument (ODT/ODS/ODP)

# Extract text from ODT
unzip -p input.odt content.xml | sed 's/<[^>]*>//g' | tr -s ' \n'

# Extract from ODS
unzip -p input.ods content.xml | sed 's/<[^>]*>//g'

# Get metadata
unzip -p input.odt meta.xml

Scripts

extract_document.sh

Extracts text and metadata from any supported document format.

~/Dropbox/jarvis/skills/document-handler/scripts/extract_document.sh <file>

Output:

  • Text content to stdout
  • Metadata as JSON comments

pdf_to_images.sh

Converts PDF pages to images for OCR or visual processing.

~/Dropbox/jarvis/skills/document-handler/scripts/pdf_to_images.sh <pdf> <output_dir> [dpi]

Workflow

  1. Identify format — Check file extension
  2. Extract text — Use appropriate tool
  3. Get metadata — Author, date, pages, etc.
  4. Process content — Summarize, search, transform

Notes

  • PDFs with scanned images need OCR (pdftoppm + tesseract)
  • Encrypted PDFs require password
  • Complex formatting may be lost in text extraction
  • For tables in PDFs, consider tabula or camelot

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 19:23 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Nano Pdf

steipete
使用nano-pdf CLI通过自然语言指令编辑PDF
★ 274 📥 114,720
productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 437 📥 147,168
productivity

Weather

steipete
获取当前天气和预报(无需API密钥)
★ 444 📥 226,102