闲社服务运行正常AI智能体自动化平台
p

PDF文档生成

技能标识:pdf-studio

Professional PDF document generator. Use when user needs to create reports, invoices, certificates, portfolios, or any publication-ready PDF. Supports images, tables, charts, TOC, headers/footers, and cross-platform fonts. Generates print-quality PDFs. PDF文档生成、专业报告、发票制作。

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.4
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

PDF文档生成

PDF Studio

专业PDF文档生成器,可生成具有完美排版和布局的出版级PDF文档。

功能特性

  • - 📑 打印质量:300 DPI,支持CMYK,出血标记
  • 🎨 专业布局:多栏排版,页眉/页脚,页码
  • 🖼️ 图片支持:嵌入图片,图注,水印
  • 📊 表格与图表:格式化表格,柱状图,饼图
  • 📐 排版:专业字体,字距调整,连字
  • 🌍 多语言:中文,英文,日文等
  • ✅ 跨平台:Windows,macOS,Linux
  • 📱 符合PDF/A标准:归档级质量

触发条件

  • - 生成PDF / Generate PDF
  • 帮我做一份报告 / Create a report
  • 制作发票 / Create an invoice
  • 生成证书 / Generate certificate
  • 制作作品集 / Create portfolio
  • pdf-studio

文档类型

商务

  • - 年度报告
  • 商业计划书
  • 发票/账单
  • 合同/协议
  • 产品手册

学术

  • - 论文排版
  • 学位证书
  • 研究报告
  • 会议论文

政府

  • - 公文
  • 公告
  • 证书
  • 表格

个人

  • - 简历
  • 作品集
  • 证书
  • 邀请函

第一步:了解需求

请提供以下信息:

文档类型:(报告/发票/证书/简历/其他)
纸张大小:(A4/Letter/A3/自定义)
方向:(纵向/横向)
页边距:(默认/自定义)
字体要求:(默认/指定字体)
语言:(中文/英文)
特殊要求:(水印/页眉页脚/目录等)



第二步:生成PDF

使用FPDF2(推荐,简单易用)

bash

安装依赖


pip install fpdf2 pillow

Python脚本模板(支持Unicode)

python
python3 << PYEOF
import os
from fpdf import FPDF
from datetime import datetime

class PDFGenerator:
def init(self, config):
self.config = config
self.html_content = []
self.css_content = []
self.font_config = FontConfiguration()

def addpagesetup(self, size=A4, orientation=portrait, margins=None):
设置页面尺寸
if margins is None:
margins = {top: 2cm, right: 2cm, bottom: 2cm, left: 2cm}

page_size = {
A4: 210mm 297mm,
Letter: 216mm 279mm,
A3: 297mm 420mm
}.get(size, size)

self.css_content.append(f
@page {{
size: {page_size} {orientation};
margin: {margins[top]} {margins[right]} {margins[bottom]} {margins[left]};

@top-center {{
content: {self.config.get(header_text, )};
font-size: 9pt;
color: #666;
}}

@bottom-center {{
content: Page counter(page) of counter(pages);
font-size: 9pt;
color: #666;
}}

@bottom-right {{
content: {self.config.get(footer_text, )};
font-size: 9pt;
color: #666;
}}
}}
)

def addbasestyles(self, fontfamily=Noto Serif SC, fontsize=12pt):
添加基础CSS样式
self.css_content.append(f
body {{
font-family: {font_family}, Noto Serif, serif;
font-size: {font_size};
line-height: 1.8;
color: #333;
}}

h1 {{
font-family: {font_family.replace(Serif, Sans)}, Noto Sans, sans-serif;
font-size: 24pt;
color: #1a365d;
border-bottom: 3px solid #3182ce;
padding-bottom: 0.5em;
margin-top: 1.5em;
page-break-after: avoid;
}}

h2 {{
font-family: {font_family.replace(Serif, Sans)}, Noto Sans, sans-serif;
font-size: 18pt;
color: #2c5282;
border-left: 4px solid #3182ce;
padding-left: 1em;
margin-top: 1.2em;
page-break-after: avoid;
}}

h3 {{
font-family: {font_family.replace(Serif, Sans)}, Noto Sans, sans-serif;
font-size: 14pt;
color: #3182ce;
margin-top: 1em;
page-break-after: avoid;
}}

p {{
text-align: justify;
text-indent: 2em;
margin: 0.5em 0;
}}

table {{
width: 100%;
border-collapse: collapse;
margin: 1em 0;
font-size: 10pt;
page-break-inside: avoid;
}}

th {{
background-color: #3182ce;
color: white;
padding: 0.8em;
text-align: left;
font-weight: 600;
}}

td {{
border: 1px solid #e2e8f0;
padding: 0.6em 0.8em;
}}

tr:nth-child(even) {{
background-color: #f7fafc;
}}

.cover {{
text-align: center;
padding-top: 30%;
page-break-after: always;
}}

.cover h1 {{
border: none;
font-size: 28pt;
}}

.cover .subtitle {{
font-size: 14pt;
color: #4a5568;
margin-top: 1em;
}}

.cover .author {{
font-size: 12pt;
margin-top: 2em;
}}

.cover .date {{
font-size: 12pt;
color: #718096;
margin-top: 1em;
}}

.toc {{
page-break-after: always;
}}

.toc a {{
color: #3182ce;
text-decoration: none;
}}

.figure {{
text-align: center;
margin: 1em 0;
page-break-inside: avoid;
}}

.figure img {{
max-width: 100%;
height: auto;
}}

.figure-caption {{
font-size: 10pt;
color: #718096;
margin-top: 0.5em;
}}

.code {{
background-color: #2d3748;
color: #e2e8f0;
padding: 1em;
border-radius: 5px;
font-family: Fira Code, Consolas, monospace;
font-size: 9pt;
white-space: pre-wrap;
page-break-inside: avoid;
}}

.highlight {{
background-color: #ebf8ff;
border: 1px solid #90cdf4;
border-radius: 5px;
padding: 1em;
margin: 1em 0;
}}

.warning {{
background-color: #fffaf0;
border: 1px solid #f6ad55;
border-radius: 5px;
padding: 1em;
margin: 1em 0;
}}

blockquote {{
border-left: 4px solid #718096;
background-color: #f7fafc;
padding: 1em;
margin: 1em 0;
font-style: italic;
}}

ul, ol {{
margin: 0.5em 0;
padding-left: 2em;
}}

li {{
margin-bottom: 0.3em;
}}

strong {{
color: #1a365d;
}}

.page-break {{
page-break-before: always;
}}
)

def add_cover(self, title, subtitle=, author=, date=None):
添加封面页
if date is None:
date = datetime.now().strftime(%Y年%m月%d日)

self.html_content.append(f

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 pdf-studio-1776052803 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 pdf-studio-1776052803 技能

通过命令行安装

skillhub install pdf-studio-1776052803

下载

⬇ 下载 pdf-studio v1.0.4(免费)

文件大小: 7.27 KB | 发布时间: 2026-4-14 09:47

v1.0.4 最新 2026-4-14 09:47
添加安全说明:明确无网络调用、无凭证请求、本地处理
返回顶部