360 Secure SkillHub
360 安全技能中心

Flow PDF Generator

核心功能是基于ReportLab从结构化JSON生成带标题、表格、列表、高亮、图片、分页的专业PDF,还可自定义品牌色。典型场景为用户需创建、导出、保存内容为PDF时使用。输入为符合Schema的JSON数据,可指定输出路径,默认存为当前目录的output.pdf。

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

安装技能

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

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