Document Tools
PDF页眉页脚片段
将HTML转换为PDF,并插入Logo/标题/日期等页眉页脚片段
file· 文件结果打开工具
快速开始
用三种语言从你的代码中调用此工具。
cURL
# 1) Request a presigned URL → returns { uploadUrl, storageKey }
curl -X POST 'https://api.elysiatools.com/api/upload/presign/pdf-header-footer-snippets' \
-H 'Content-Type: application/json' \
-d '{"filename":"logoFile.ext","contentType":"application/octet-stream","size":12345}'
# 2) PUT the file bytes directly to the presigned uploadUrl
curl -X PUT '<presigned uploadUrl>' \
--data-binary @/path/to/file.ext
# 3) Call the tool, passing the returned storageKey for each file field
curl -X POST 'https://api.elysiatools.com/zh/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=uploads/2026/01/01/your-tool-1700000000000-abc123.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'