Document Tools
Создание PDF документов с текстом, абзацами, верхними и нижними колонтитулами
Вызовите этот инструмент из своего кода на трёх языках.
curl -X POST 'https://api.elysiatools.com/ru/api/tools/pdf-basic-text-doc' \
-H 'Content-Type: application/json' \
-d '{"content":"Введите содержимое документа здесь...\n\nВы можете разделять абзацы пустыми строками.","title":"Мой Документ","pageSize":"A4","orientation":"portrait","fontSize":12,"lineHeight":1.5,"marginTop":72,"marginBottom":72,"marginLeft":72,"marginRight":72,"showHeader":false,"headerText":"Верхний Колонтитул Документа","headerAlignment":"center","showFooter":false,"footerText":"Page {page} of {total}","footerAlignment":"center","showPageNumbers":true,"pageNumberPosition":"bottom-center"}'Отправьте POST-запрос с входными данными в JSON. Параметры типа «файл» требуют предварительной загрузки.
POST https://api.elysiatools.com/ru/api/tools/pdf-basic-text-doc| Имя | Тип | Обязательный | Описание |
|---|---|---|---|
| content | textarea | Да | — |
| title | text | Нет | — |
| pageSize | select | Нет | — |
| orientation | select | Нет | — |
| fontSize | number | Нет | — |
| lineHeight | number | Нет | — |
| marginTop | number | Нет | — |
| marginBottom | number | Нет | — |
| marginLeft | number | Нет | — |
| marginRight | number | Нет | — |
| showHeader | checkbox | Нет | — |
| headerText | text | Нет | — |
| headerAlignment | select | Нет | — |
| showFooter | checkbox | Нет | — |
| footerText | text | Нет | — |
| footerAlignment | select | Нет | — |
| showPageNumbers | checkbox | Нет | — |
| pageNumberPosition | 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, чтобы ИИ-агенты могли перечислять и вызывать его.
Добавьте этот блок в конфигурацию вашего MCP-клиента:
{
"mcpServers": {
"elysiatools-pdf-basic-text-doc": {
"name": "pdf-basic-text-doc",
"description": "Создание PDF документов с текстом, абзацами, верхними и нижними колонтитулами",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=pdf-basic-text-doc",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}После подключения к SSE-endpoint выведите список доступных инструментов:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Вызовите инструмент по его id; аргументы формируются из его параметров:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "pdf-basic-text-doc",
"arguments": {
"content": "Введите содержимое документа здесь...\n\nВы можете разделять абзацы пустыми строками.",
"title": "Мой Документ",
"pageSize": "A4",
"orientation": "portrait",
"fontSize": 12,
"lineHeight": 1.5,
"marginTop": 72,
"marginBottom": 72,
"marginLeft": 72,
"marginRight": 72,
"showHeader": false,
"headerText": "Верхний Колонтитул Документа",
"headerAlignment": "center",
"showFooter": false,
"footerText": "Page {page} of {total}",
"footerAlignment": "center",
"showPageNumbers": true,
"pageNumberPosition": "bottom-center"
}
}
}Вопросы или проблемы? Свяжитесь с [email protected]