360 Secure SkillHub
360 安全技能中心

PragDev PDF Generator

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

flexrox
flexrox
热度 32.88
最近更新 2026-05-11 17:46:09
分类:效率依赖:代码执行 / 读写文件应用场景:文件转换 / 报告撰写

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add 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