Document Tools
实验排版设置:行距、间距、对齐和缩进
用三种语言从你的代码中调用此工具。
curl -X POST 'https://api.elysiatools.com/zh/api/tools/pdf-typography-playground' \
-H 'Content-Type: application/json' \
-d '{"content":"Typography is the art and technique of arranging type to make written language legible, readable, and appealing when displayed.\n\nThe arrangement of type involves selecting typefaces, point sizes, line lengths, line-spacing (leading), and letter-spacing (tracking), and adjusting the space between pairs of letters (kerning).\n\nGood typography creates a visual hierarchy that guides the reader through the content. It establishes tone and mood, enhances readability, and communicates the intended message effectively.","fontSize":12,"fontWeight":"normal","lineHeight":1.5,"paragraphSpacingBefore":0,"paragraphSpacingAfter":12,"textAlign":"left","firstLineIndent":0,"leftIndent":0,"rightIndent":0,"letterSpacing":0,"wordSpacing":0,"showBaseline":false,"showGrid":false,"showBorder":false,"showHeader":false,"headerText":"文档页眉","headerAlignment":"center","showFooter":false,"footerText":"Page {page} of {total}","footerAlignment":"center"}'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/pdf-typography-playground| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| content | textarea | 是 | — |
| fontSize | number | 否 | — |
| fontWeight | select | 否 | — |
| lineHeight | number | 否 | — |
| paragraphSpacingBefore | number | 否 | — |
| paragraphSpacingAfter | number | 否 | — |
| textAlign | select | 否 | — |
| firstLineIndent | number | 否 | — |
| leftIndent | number | 否 | — |
| rightIndent | number | 否 | — |
| letterSpacing | number | 否 | — |
| wordSpacing | number | 否 | — |
| showBaseline | checkbox | 否 | — |
| showGrid | checkbox | 否 | — |
| showBorder | checkbox | 否 | — |
| showHeader | checkbox | 否 | — |
| headerText | text | 否 | — |
| headerAlignment | select | 否 | — |
| showFooter | checkbox | 否 | — |
| footerText | text | 否 | — |
| footerAlignment | select | 否 | — |
文件结果
{
"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-typography-playground": {
"name": "pdf-typography-playground",
"description": "实验排版设置:行距、间距、对齐和缩进",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=pdf-typography-playground",
"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-typography-playground",
"arguments": {
"content": "Typography is the art and technique of arranging type to make written language legible, readable, and appealing when displayed.\n\nThe arrangement of type involves selecting typefaces, point sizes, line lengths, line-spacing (leading), and letter-spacing (tracking), and adjusting the space between pairs of letters (kerning).\n\nGood typography creates a visual hierarchy that guides the reader through the content. It establishes tone and mood, enhances readability, and communicates the intended message effectively.",
"fontSize": 12,
"fontWeight": "normal",
"lineHeight": 1.5,
"paragraphSpacingBefore": 0,
"paragraphSpacingAfter": 12,
"textAlign": "left",
"firstLineIndent": 0,
"leftIndent": 0,
"rightIndent": 0,
"letterSpacing": 0,
"wordSpacing": 0,
"showBaseline": false,
"showGrid": false,
"showBorder": false,
"showHeader": false,
"headerText": "文档页眉",
"headerAlignment": "center",
"showFooter": false,
"footerText": "Page {page} of {total}",
"footerAlignment": "center"
}
}
}有问题或反馈?请联系 [email protected]