OpenParable
Skip to content
← Back to skills

PDF Metadata Extract

Documents
pdf_metadata_extract

PDF Metadata Extract is an Agent Skill for documents published in the cas-bigdatalab/piflow repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

提取PDF文件的元数据(标题、作者、主题、页数等),输出为JSON格式。当用户需要查看PDF文档信息时使用此skill。

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/cas-bigdatalab/piflow/blob/HEAD/piflow_engine/cn/piflow/tests/workspace/.sandbox/skills/pdf_metadata_extract_3d1770487a16/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/pdf-metadata-extract, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

pdf_metadata_extract 技能

功能说明

该技能提取PDF文件的元数据(标题、作者、主题、页数等),输出为JSON格式,便于查看和处理PDF文档信息。

核心功能

  • 提取PDF基本信息(文件名、大小、页数)
  • 提取文档元数据(标题、作者、主题、创建者等)
  • 提取日期信息(创建日期、修改日期)
  • 检测PDF是否加密

使用方法

python scripts/run_pdf_metadata_extract.py --input_path <输入PDF> --output_path <输出JSON>

参数说明

参数类型必填默认值说明
input_pathstring是-输入PDF文件路径
output_pathstring是-输出JSON文件路径

示例

python scripts/run_pdf_metadata_extract.py --input_path document.pdf --output_path metadata.json

输出格式

{
  "file_name": "document.pdf",
  "file_size": 1024000,
  "pages": 20,
  "pdf_version": "PDF-1.7",
  "title": "Document Title",
  "author": "John Doe",
  "subject": "Document Subject",
  "creator": "Microsoft Word",
  "producer": "Microsoft Word 2016",
  "creation_date": "2024-01-15 10:30:00",
  "modification_date": "2024-01-15 14:20:00",
  "is_encrypted": false
}

注意事项

  • 输出目录不存在时会自动创建
  • 部分PDF可能没有完整的元数据,缺失字段会显示为null