360 Secure SkillHub
360 安全技能中心

PragDev PDF Generator

核心功能:基于ReportLab将结构化JSON数据生成带样式的专业PDF,支持标题、表格、列表、高亮、图片、分页,可自定义品牌色。典型场景:用户需创建、导出或保存内容为PDF(如生成月度报告)。输入为符合Schema的JSON数据,可通过命令行指定输出路径;输出为指定路径的PDF,默认存当前目录output.pdf。

flexrox
flexrox
热度 32.87
最近更新 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