Document Tools
预览PDF中从左到右与从右到左的双向文字排版效果
用三种语言从你的代码中调用此工具。
# 1) Upload each file first → returns { filePath }
curl -X POST 'https://api.elysiatools.com/upload/pdf-rtl-ltr-support' \
-F 'file=@/path/to/fontFile.ext'
# 2) Call the tool with the returned filePath values
curl -X POST 'https://api.elysiatools.com/zh/api/tools/pdf-rtl-ltr-support' \
-F 'ltrText=输入从左到右文本...' \
-F 'rtlText=输入从右到左文本...' \
-F 'baseDirection=auto' \
-F 'alignment=auto' \
-F 'fontSize=14' \
-F 'lineHeight=1.5' \
-F 'pageSize=A4' \
-F 'marginTop=72' \
-F 'marginBottom=72' \
-F 'marginLeft=72' \
-F 'marginRight=72' \
-F 'showGuides=true' \
-F 'includeMixedSample=true' \
-F 'fontFile=/path/to/file.ext'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/pdf-rtl-ltr-support| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| ltrText | textarea | 是 | — |
| rtlText | textarea | 是 | — |
| baseDirection | select | 否 | — |
| alignment | select | 否 | — |
| fontSize | number | 否 | — |
| lineHeight | number | 否 | — |
| pageSize | select | 否 | — |
| marginTop | number | 否 | — |
| marginBottom | number | 否 | — |
| marginLeft | number | 否 | — |
| marginRight | number | 否 | — |
| showGuides | checkbox | 否 | — |
| includeMixedSample | checkbox | 否 | — |
| fontFile | file需先上传 | 否 | — |
文件结果
{
"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-rtl-ltr-support": {
"name": "pdf-rtl-ltr-support",
"description": "预览PDF中从左到右与从右到左的双向文字排版效果",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=pdf-rtl-ltr-support",
"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-rtl-ltr-support",
"arguments": {
"ltrText": "输入从左到右文本...",
"rtlText": "输入从右到左文本...",
"baseDirection": "auto",
"alignment": "auto",
"fontSize": 14,
"lineHeight": 1.5,
"pageSize": "A4",
"marginTop": 72,
"marginBottom": 72,
"marginLeft": 72,
"marginRight": 72,
"showGuides": true,
"includeMixedSample": true,
"fontFile": "https://example.com/file.ext"
}
}
}有问题或反馈?请联系 [email protected]