聊天记录转PDF
将多角色聊天记录排版为对话式PDF
将聊天记录JSON排版为对话式PDF。
**输入:** JSON数组,或包含 messages 的对象
**输出:** 气泡样式对话PDF
**示例:**
```json
{ "messages": [
{ "role": "system", "content": "简洁友好回复。" },
{ "role": "user", "content": "请总结我的账单。" },
{ "role": "assistant", "content": "账单$420,截止 2026-02-20。" }
] }
```
API 文档
请求端点
POST /zh/api/tools/chat-transcript-to-pdf
请求参数
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| transcriptJson | textarea | 否 | - |
| transcriptFile | file (需要先上传) | 否 | - |
| title | text | 否 | - |
| showTimestamps | checkbox | 否 | - |
| accentColor | color | 否 | - |
| userBubbleColor | color | 否 | - |
| assistantBubbleColor | color | 否 | - |
| systemBubbleColor | color | 否 | - |
| baseFontSize | number | 否 | - |
| pageSize | select | 否 | - |
| landscape | checkbox | 否 | - |
| printBackground | checkbox | 否 | - |
| marginTop | number | 否 | - |
| marginBottom | number | 否 | - |
| marginLeft | number | 否 | - |
| marginRight | number | 否 | - |
| waitUntil | select | 否 | - |
| waitTime | number | 否 | - |
文件类型参数需要先通过 POST /upload/chat-transcript-to-pdf 上传获取 filePath,然后将 filePath 传递给对应的文件字段。
响应格式
{
"filePath": "/public/processing/randomid.ext",
"fileName": "output.ext",
"contentType": "application/octet-stream",
"size": 1024,
"metadata": {
"key": "value"
},
"error": "Error message (optional)",
"message": "Notification message (optional)"
}
文件:
文件
AI MCP 文档
将此工具添加到您的 MCP 服务器配置中:
{
"mcpServers": {
"elysiatools-chat-transcript-to-pdf": {
"name": "chat-transcript-to-pdf",
"description": "将多角色聊天记录排版为对话式PDF",
"baseUrl": "https://elysiatools.com/mcp/sse?toolId=chat-transcript-to-pdf",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}
你可以串联多个工具,比如:`https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`,最多20个。
支持 URL 文件链接或 Base64 编码作为文件参数。
如果遇见问题,请联系我们:[email protected]