文档

pypdf

试用

Extract text, metadata, and pages from PDF files using pypdf. Use for tasks such as reading PDF content, extracting specific pages, splitting or merging PDFs...

它能做什么

Extract text, metadata, and pages from PDF files using pypdf. Use for tasks such as reading PDF content, extracting specific pages, splitting or merging PDFs...

技能文档

pypdf

Use scripts/pypdf_cli.py for deterministic PDF operations instead of ad-hoc pypdf snippets.

Workflow

  1. Confirm the PDF file path is accessible locally.
  2. Run the desired command (inspect, extract-text, extract-pages, merge, split, rotate).
  3. Inspect text output or the resulting PDF file.

Command Guide

  • Inspect metadata and page count:
    • python scripts/pypdf_cli.py info --input
  • Extract all text:
    • python scripts/pypdf_cli.py extract-text --input
  • Extract text from specific pages (0-indexed):
    • python scripts/pypdf_cli.py extract-text --input --pages 0 1 2
  • Split PDF into individual pages:
    • python scripts/pypdf_cli.py split --input --output-dir
  • Extract a page range into a new PDF:
    • python scripts/pypdf_cli.py extract-pages --input --pages 0 1 2 --output
  • Merge multiple PDFs:
    • python scripts/pypdf_cli.py merge --inputs --output
  • Rotate pages:
    • python scripts/pypdf_cli.py rotate --input --angle 90 --output
    • --angle must be 90, 180, or 270.
    • Optionally restrict to specific pages with --pages 0 2.

Operational Rules

  • Pages are always 0-indexed in all commands.
  • For extract-text, output goes to stdout; redirect to a file when needed.
  • Require explicit --output for commands that write a new PDF.
  • Install dependency if missing: pip install pypdf.

相关技能

Render PDF pages to images, extract embedded images, annotate PDFs, and perform advanced PDF inspection using pymupdf (fitz). Use for tasks such as exporting...

29 次安装

将 PDF 和图片转换为 10 种文档或数据格式,并提供 OCR 与版面分析控制。

作者 ComPDF32 次安装95 星标

通过 ComPDF Cloud API 执行 50 多种 PDF 与文档处理操作。

38 次安装99 星标

Convert unstructured documents into LLM-ready structured data. Supports PDF, Word, PPT, and images; extracts paragraphs, formulas, tables, charts, and other...

24 次安装1 星标

通过 ComPDF Cloud API 处理 PDF 文件,覆盖 50 余种文档操作。

28 次安装102 星标

通过 xparse-cli 把 PDF、图片、Office、HTML、OFD 等文档转为结构化的 Markdown 或 JSON。

28 次安装2 星标