Document Tools
Converte HTML em PDF com numeração romana, arábica ou prefixo de capítulo
Chame esta ferramenta a partir do seu código em três idiomas.
curl -X POST 'https://api.elysiatools.com/pt/api/tools/pdf-page-numbering-styles' \
-H 'Content-Type: application/json' \
-d '{"htmlContent":"\n<h1>Quarterly Report</h1>\n<p>This is a generated test document.</p>\n<div style=\"page-break-after: always;\"></div>\n<h2>Second Page</h2>\n<p>More sample content.</p>\n","cssContent":"\nbody { font-family: Arial, sans-serif; }\nh1, h2 { color: #1f2937; }\np { font-size: 12pt; }\n","pageSize":"A4","landscape":false,"printBackground":true,"marginTop":20,"marginBottom":20,"marginLeft":20,"marginRight":20,"numberingStyle":"arabic","startPageNumber":1,"includeTotalPages":true,"chapterPrefixTemplate":"Chapter {chapter} - ","chapterNumber":1,"labelPrefix":"Page ","labelSuffix":"","numberPosition":"footer-right","edgeOffsetMm":10,"fontSize":10,"fontColor":"#333333","waitUntil":"networkidle0","waitTime":0}'Envie uma requisição POST com suas entradas em JSON. Parâmetros do tipo arquivo exigem upload prévio.
POST https://api.elysiatools.com/pt/api/tools/pdf-page-numbering-styles| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| htmlContent | textarea | Sim | — |
| cssContent | textarea | Não | — |
| pageSize | select | Não | — |
| landscape | checkbox | Não | — |
| printBackground | checkbox | Não | — |
| marginTop | number | Não | — |
| marginBottom | number | Não | — |
| marginLeft | number | Não | — |
| marginRight | number | Não | — |
| numberingStyle | select | Não | — |
| startPageNumber | number | Não | — |
| includeTotalPages | checkbox | Não | — |
| chapterPrefixTemplate | text | Não | — |
| chapterNumber | number | Não | — |
| labelPrefix | text | Não | — |
| labelSuffix | text | Não | — |
| numberPosition | select | Não | — |
| edgeOffsetMm | number | Não | — |
| fontSize | number | Não | — |
| fontColor | color | Não | — |
| waitUntil | select | Não | — |
| waitTime | number | Não | — |
Resultado de arquivo
{
"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)"
}Adicione esta ferramenta ao seu servidor Model Context Protocol para que agentes de IA possam listá-la e chamá-la.
Adicione este bloco à configuração do seu cliente MCP:
{
"mcpServers": {
"elysiatools-pdf-page-numbering-styles": {
"name": "pdf-page-numbering-styles",
"description": "Converte HTML em PDF com numeração romana, arábica ou prefixo de capítulo",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=pdf-page-numbering-styles",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}Após conectar ao endpoint SSE, liste as ferramentas expostas:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoque a ferramenta pelo seu id; os argumentos são construídos a partir de seus parâmetros:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "pdf-page-numbering-styles",
"arguments": {
"htmlContent": "\n<h1>Quarterly Report</h1>\n<p>This is a generated test document.</p>\n<div style=\"page-break-after: always;\"></div>\n<h2>Second Page</h2>\n<p>More sample content.</p>\n",
"cssContent": "\nbody { font-family: Arial, sans-serif; }\nh1, h2 { color: #1f2937; }\np { font-size: 12pt; }\n",
"pageSize": "A4",
"landscape": false,
"printBackground": true,
"marginTop": 20,
"marginBottom": 20,
"marginLeft": 20,
"marginRight": 20,
"numberingStyle": "arabic",
"startPageNumber": 1,
"includeTotalPages": true,
"chapterPrefixTemplate": "Chapter {chapter} - ",
"chapterNumber": 1,
"labelPrefix": "Page ",
"labelSuffix": "",
"numberPosition": "footer-right",
"edgeOffsetMm": 10,
"fontSize": 10,
"fontColor": "#333333",
"waitUntil": "networkidle0",
"waitTime": 0
}
}
}Dúvidas ou problemas? Contate [email protected]