Communitygithub.com

Rylai PDF

使用本地开源工具创建、检查、提取、合并、拆分、旋转和渲染PDF文件,包括结构和视觉验证。

Rylai PDF 是什么?

Rylai PDF 技能是一个面向开发者和AI代理的本地PDF处理工具集,通过Python集成 pypdf、pdfplumber、pypdfium2 和 Poppler 等主流库,支持PDF文件的创建、检查、文本提取、页面合并/拆分、旋转和渲染等操作。该技能强调安全性和可控性:所有操作默认保存为新文件,除非用户明确要求原地替换;密码和凭据不会被凭空发明或嵌入工具中;文档不会上传到外部服务。技能遵循结构化工作流:先确认输入输出和操作类型,运行info命令检查文件状态,然后执行操作,最后对结果进行页面数、元数据和文本内容的验证,必要时渲染页面进行视觉检查。适用于Cline、Claude Code、Aider、Codex等平台,支持扫描页面的本地OCR(如果可用),并记录使用的OCR工具和语言模型。质量门槛包括输出无修复警告、页面顺序和旋转与请求一致、提取文本不为空、渲染页面无意外裁剪。

兼容平台✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/Rylaispirit/rylai-codex-hermes-skills/tree/HEAD/skills/pdf

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Rylai PDF 是做什么的?

由 Rylai 编写的原始 Codex-Hermes-Claude 技能。

使用本地文件和确定性工具。除非用户明确要求原地替换,否则保留源文档。绝不凭空发明密码、嵌入凭据或将文档上传到外部服务,除非获得直接批准。

运行时

使用 Python 3 并搭配:

  • pypdf 用于页面级别的检查和编辑。
  • pdfplumber 用于需要更高质量文本提取的场景。
  • pypdfium2 或 Poppler pdftoppm 用于可选的页面渲染。
  • 仅在将 Office 源文件转换为 PDF 时使用 LibreOffice。

安装前先探测:

python -c "import pypdf; print(pypdf.__version__)"
python -c "import pdfplumber; print(pdfplumber.__version__)"

仅安装缺失的 Python 包:

python -m pip install pypdf pdfplumber pypdfium2

解析相对于此技能目录的 scripts/rylai_pdf.py。

工作流程

  1. 确认输入路径、请求的操作、输出路径和页面范围。
  2. 在编辑不熟悉或加密的 PDF 之前,先运行 info 命令。
  3. 写入新的输出路径。仅当需要替换时才使用 --force。
  4. 重新打开结果,检查页数、元数据以及在适用情况下的提取文本。
  5. 对于布局敏感的工作,渲染代表性页面并检查 PNG 输出。
  6. 当 Poppler、LibreOffice、OCR 或其他可选依赖项缺失时,报告跳过的检查。

对于没有有效文本层的扫描页面,使用可用的本地 OCR 引擎。保留原始 PDF,并说明使用了哪个 OCR 工具和语言模型。

捆绑的 CLI

检查:

python scripts/rylai_pdf.py info input.pdf

提取选中页面:

python scripts/rylai_pdf.py extract input.pdf output.txt --pages 1-3,7

合并:

python scripts/rylai_pdf.py merge output.pdf first.pdf second.pdf

将选中页面拆分为单独文件:

python scripts/rylai_pdf.py split input.pdf output-pages --pages 2-5

将选中页面顺时针旋转:

python scripts/rylai_pdf.py rotate input.pdf rotated.pdf 90 --pages 1,3

使用本地 PDFium 或 Poppler 渲染:

python scripts/rylai_pdf.py render input.pdf rendered-pages --dpi 144

仅当用户提供了该文档的密码时才添加 --password。

质量标准

  • 输出文件打开时不带修复警告。
  • 页面顺序、页数、旋转和选定的范围与请求一致。
  • 提取的文本不会静默地为空;能够识别扫描页面。
  • 渲染的页面没有意外裁剪或空白输出。
  • 源文件、临时文件、密码或用户路径不附带在此技能中。

Individual skills in this repo

This repo contains 12 individual skills — each has its own dedicated page.

Rylaispirit/rylai-codex-hermes-skills

Plan, build, render, and verify academic presentation decks with citations, accessible visuals, clear argument flow, speaker-ready pacing, and visual QA.

Rylaispirit/rylai-codex-hermes-skills

Create publication-quality chart images from supplied data using an available plotting library, with explicit scales, labels, and visual QA.

Rylaispirit/rylai-codex-hermes-skills

Plan, draft, and review persuasive copy for landing pages, product pages, ads, email, headlines, offers, calls to action, positioning, and message variants.

Rylaispirit/rylai-codex-hermes-skills

Plan, draft, revise, and audit creative or long-form writing with a portable core workflow that does not depend on missing legacy templates.

Rylaispirit/rylai-codex-hermes-skills

Create, inspect, edit, and verify Word DOCX files with python-docx, including Markdown conversion, text replacement, metadata inspection, and optional PDF render.

Rylaispirit/rylai-codex-hermes-skills

Create or optimize marketing images, social graphics, product mockups, banners, cover art, listing visuals, brand assets, image prompts, WebP files, and OG images.

Rylaispirit/rylai-codex-hermes-skills

Create, inspect, extract, edit, render, and verify PowerPoint presentations with python-pptx and optional LibreOffice.

Rylaispirit/rylai-codex-hermes-skills

Create editable PowerPoint decks from a local JSON specification using Rylai's visual system, python-pptx, deterministic slide types, and optional rendering.

Rylaispirit/rylai-codex-hermes-skills

Perform an evidence-led SEO audit using accessible pages, source code, crawl data, and current search documentation without assuming missing plugins.

Rylaispirit/rylai-codex-hermes-skills

Extract a practical design system from screenshots or mockups and produce implementation-ready UI specifications using vision and repository context.

Rylaispirit/rylai-codex-hermes-skills

Plan and produce video with available AI tools or programmatic frameworks. Use for video prompts, avatars, explainers, demos, templates, pipelines, and generation.

Rylaispirit/rylai-codex-hermes-skills

Create, inspect, edit, and verify Excel XLSX workbooks with openpyxl, including CSV import, formulas, styling, error checks, and optional LibreOffice rendering.

相关技能