Document Tools
创建报纸/杂志风格的多栏PDF文档
用三种语言从你的代码中调用此工具。
curl -X POST 'https://api.elysiatools.com/zh/api/tools/pdf-multi-column-layout' \
-H 'Content-Type: application/json' \
-d '{"content":"在此输入您的文章文本...","headline":"文章标题","subheadline":"文章副标题或摘要","author":"作者:张三","date":"2025年1月1日","columnCount":"2","gutterWidth":18,"columnBalance":"auto","textAlign":"justify","headlineFontSize":24,"bodyFontSize":10,"lineHeight":1.2,"showSeparatorLines":false,"showDropCap":false,"dropCapLines":3,"showHeader":false,"headerText":"文档页眉","headerAlignment":"center","showFooter":false,"footerText":"Page {page} of {total}","footerAlignment":"center","marginTop":72,"marginBottom":72,"marginLeft":72,"marginRight":72}'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/pdf-multi-column-layout| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| content | textarea | 是 | — |
| headline | text | 否 | — |
| subheadline | text | 否 | — |
| author | text | 否 | — |
| date | text | 否 | — |
| columnCount | select | 否 | — |
| gutterWidth | number | 否 | 栏之间的间距 |
| columnBalance | select | 否 | — |
| textAlign | select | 否 | — |
| headlineFontSize | number | 否 | — |
| bodyFontSize | number | 否 | — |
| lineHeight | number | 否 | — |
| showSeparatorLines | checkbox | 否 | — |
| showDropCap | checkbox | 否 | — |
| dropCapLines | number | 否 | — |
| showHeader | checkbox | 否 | — |
| headerText | text | 否 | — |
| headerAlignment | select | 否 | — |
| showFooter | checkbox | 否 | — |
| footerText | text | 否 | — |
| footerAlignment | select | 否 | — |
| marginTop | number | 否 | — |
| marginBottom | number | 否 | — |
| marginLeft | number | 否 | — |
| marginRight | number | 否 | — |
文件结果
{
"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)"
}将此工具加入你的 Model Context Protocol 服务,让 AI 智能体可以列出并调用它。
将以下内容加入你的 MCP 客户端配置:
{
"mcpServers": {
"elysiatools-pdf-multi-column-layout": {
"name": "pdf-multi-column-layout",
"description": "创建报纸/杂志风格的多栏PDF文档",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=pdf-multi-column-layout",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}连接到 SSE 端点后,列出已开放的工具:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}通过工具 id 调用,参数由其参数表构建:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "pdf-multi-column-layout",
"arguments": {
"content": "在此输入您的文章文本...",
"headline": "文章标题",
"subheadline": "文章副标题或摘要",
"author": "作者:张三",
"date": "2025年1月1日",
"columnCount": "2",
"gutterWidth": 18,
"columnBalance": "auto",
"textAlign": "justify",
"headlineFontSize": 24,
"bodyFontSize": 10,
"lineHeight": 1.2,
"showSeparatorLines": false,
"showDropCap": false,
"dropCapLines": 3,
"showHeader": false,
"headerText": "文档页眉",
"headerAlignment": "center",
"showFooter": false,
"footerText": "Page {page} of {total}",
"footerAlignment": "center",
"marginTop": 72,
"marginBottom": 72,
"marginLeft": 72,
"marginRight": 72
}
}
}有问题或反馈?请联系 [email protected]