add_html_header_footer_to_pdf
Add custom HTML as header, footer, or both on PDF pages, with options to target specific pages, set margins, and skip the first page.
Instructions
Add HTML as header, footer, or both on PDF pages using PDF4me AddHtmlHeaderFooter (/api/v2/AddHtmlHeaderFooter). html_content is a plain HTML string (not base64). header_footer_location is Header, Footer, or Both. Optional: pages (empty string = all), skip_first_page, pixel margins, output path.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pdf_file_path": "<pdf_file_path>",
"html_content": "<html_content>",
"header_footer_location": "<header_footer_location>"
},
"name": "add_html_header_footer_to_pdf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pages | No | ||
| margin_top | No | ||
| output_dir | No | ||
| margin_left | No | ||
| html_content | Yes | ||
| margin_right | No | ||
| margin_bottom | No | ||
| pdf_file_path | Yes | ||
| skip_first_page | No | ||
| output_file_name | No | ||
| request_doc_name | No | ||
| header_footer_location | Yes |