360 Secure SkillHub
360 安全技能中心

PragDev PDF Generator

该 Skill 通过 Python 脚本将结构化 JSON 数据渲染为样式化 PDF 文档,支持标题、副标题、作者、正文、高亮、列表、表格、图片和分页,并可通过颜色字段设置品牌配色。需本地执行脚本,输出为指定路径的 PDF 文件。

分类:效率
flexrox
flexrox
热度 29.83
最近更新 2026-05-11 17:46:09

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add flexrox/pragdev-pdf-generator
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
pdf-generator
description
Generate professional PDF documents from structured JSON data. Use when user wants to create, export, or save content as a PDF file. Supports styled titles, tables, lists, highlights, images, and page breaks. Trigger phrases: Export as PDF, Generate PDF, Create PDF report, Save as PDF, PDF erstellen, PDF generieren, als PDF speichern.

PDF Generator

Generate styled PDF documents from structured JSON data using ReportLab.

Quick Start

python scripts/generate_pdf.py --output report.pdf --data '{
  "title": "Monthly Report",
  "subtitle": "March 2026",
  "author": "PragDev",
  "sections": [
    {"type": "text", "text": "Introduction text here."},
    {"type": "highlight", "text": "Key metric: +15%"},
    {"type": "list", "items": ["Item 1", "Item 2"]}
  ]
}'

JSON Schema Reference

See references/schema.md for complete schema documentation.

Output

  • PDF saved to path specified by --output or data.output
  • Default: output.pdf in current directory

Tips

  • Use accent_color and header_color for brand colors
  • Tables auto-alternate row backgrounds
  • Images must exist at the specified path
  • Page breaks create new pages