分类

PDF页眉页脚片段

将HTML转换为PDF,并插入Logo/标题/日期等页眉页脚片段

渲染HTML为PDF,并插入可复用的页眉/页脚片段。 **支持片段:** - Logo(图片上传) - 标题文本 - 日期(ISO/本地/自定义) - 可选页脚页码 **布局:** - 左/中/右分区布局 - 配合页边距预留页眉页脚空间

Click to upload file or drag and drop file here

Maximum file size: 5MB Supported formats: image/png, image/jpeg, image/svg+xml, image/webp

API 文档

请求端点

POST /zh/api/tools/pdf-header-footer-snippets

请求参数

参数名 类型 必填 描述
htmlContent textarea -
cssContent textarea -
pageSize select -
landscape checkbox -
printBackground checkbox -
marginTop number -
marginBottom number -
marginLeft number -
marginRight number -
headerEnabled checkbox -
footerEnabled checkbox -
logoFile file (需要先上传) -
logoWidth number -
headerTitle text -
footerTitle text -
showDateInHeader checkbox -
showDateInFooter checkbox -
dateFormat select -
customDateText text -
showPageNumbers checkbox -
waitUntil select -
waitTime number -

文件类型参数需要先通过 POST /upload/pdf-header-footer-snippets 上传获取 filePath,然后将 filePath 传递给对应的文件字段。

响应格式

{
  "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)"
}
文件: 文件

AI MCP 文档

将此工具添加到您的 MCP 服务器配置中:

{
  "mcpServers": {
    "elysiatools-pdf-header-footer-snippets": {
      "name": "pdf-header-footer-snippets",
      "description": "将HTML转换为PDF,并插入Logo/标题/日期等页眉页脚片段",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=pdf-header-footer-snippets",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

你可以串联多个工具,比如:`https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`,最多20个。

支持 URL 文件链接或 Base64 编码作为文件参数。

如果遇见问题,请联系我们:[email protected]