Document Tools
Convierte HTML a PDF e inserta fragmentos de logo, título y fecha
Llama a esta herramienta desde tu código en tres lenguajes.
# 1) Upload each file first → returns { filePath }
curl -X POST 'https://api.elysiatools.com/upload/pdf-header-footer-snippets' \
-F 'file=@/path/to/logoFile.ext'
# 2) Call the tool with the returned filePath values
curl -X POST 'https://api.elysiatools.com/es/api/tools/pdf-header-footer-snippets' \
-F 'htmlContent=
<h1>Quarterly Report</h1>
<p>This is a generated test document.</p>
<div style="page-break-after: always;"></div>
<h2>Second Page</h2>
<p>More sample content.</p>
' \
-F 'cssContent=
body { font-family: Arial, sans-serif; }
h1, h2 { color: #1f2937; }
p { font-size: 12pt; }
' \
-F 'pageSize=A4' \
-F 'landscape=false' \
-F 'printBackground=true' \
-F 'marginTop=18' \
-F 'marginBottom=18' \
-F 'marginLeft=20' \
-F 'marginRight=20' \
-F 'headerEnabled=true' \
-F 'footerEnabled=true' \
-F 'logoFile=/path/to/file.ext' \
-F 'logoWidth=80' \
-F 'headerTitle=Quarterly Report' \
-F 'footerTitle=Internal' \
-F 'showDateInHeader=true' \
-F 'showDateInFooter=false' \
-F 'dateFormat=locale' \
-F 'customDateText=March 2026' \
-F 'showPageNumbers=true' \
-F 'waitUntil=networkidle0' \
-F 'waitTime=0'Envía una petición POST con tus entradas en JSON. Los parámetros de tipo archivo requieren una subida previa.
POST https://api.elysiatools.com/es/api/tools/pdf-header-footer-snippets| Nombre | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| htmlContent | textarea | Sí | — |
| cssContent | textarea | No | — |
| pageSize | select | No | — |
| landscape | checkbox | No | — |
| printBackground | checkbox | No | — |
| marginTop | number | No | — |
| marginBottom | number | No | — |
| marginLeft | number | No | — |
| marginRight | number | No | — |
| headerEnabled | checkbox | No | — |
| footerEnabled | checkbox | No | — |
| logoFile | filesubida requerida | No | — |
| logoWidth | number | No | — |
| headerTitle | text | No | — |
| footerTitle | text | No | — |
| showDateInHeader | checkbox | No | — |
| showDateInFooter | checkbox | No | — |
| dateFormat | select | No | — |
| customDateText | text | No | — |
| showPageNumbers | checkbox | No | — |
| waitUntil | select | No | — |
| waitTime | number | No | — |
Resultado de archivo
{
"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)"
}Añade esta herramienta a tu servidor Model Context Protocol para que los agentes de IA puedan listarla y llamarla.
Añade este bloque a la configuración de tu cliente MCP:
{
"mcpServers": {
"elysiatools-pdf-header-footer-snippets": {
"name": "pdf-header-footer-snippets",
"description": "Convierte HTML a PDF e inserta fragmentos de logo, título y fecha",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=pdf-header-footer-snippets",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}Tras conectar al endpoint SSE, lista las herramientas expuestas:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoca la herramienta por su id; los argumentos se construyen a partir de sus parámetros:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "pdf-header-footer-snippets",
"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": 18,
"marginBottom": 18,
"marginLeft": 20,
"marginRight": 20,
"headerEnabled": true,
"footerEnabled": true,
"logoFile": "https://example.com/file.ext",
"logoWidth": 80,
"headerTitle": "Quarterly Report",
"footerTitle": "Internal",
"showDateInHeader": true,
"showDateInFooter": false,
"dateFormat": "locale",
"customDateText": "March 2026",
"showPageNumbers": true,
"waitUntil": "networkidle0",
"waitTime": 0
}
}
}¿Dudas o problemas? Contacta con [email protected]