Add Image Header/Footer to Excel using n8n action
PDF4me Add Image Header Footer to Excel enables adding customizable image headers and footers to Excel documents through n8n automation workflows. Process Excel files via n8n triggers, binary data, base64 strings, or public URLs to add company logos, watermark images, branding elements, and visual stamps with full control over image placement (header/footer), position alignment (left, center, right), worksheet targeting (specific sheets or all sheets), and page margins. This solution is ideal for corporate branding, professional document presentation, logo insertion, and automated formatting workflows that require image headers and footers with comprehensive positioning control and seamless integration.
Setup
Add the PDF4me "Add Image Header Footer" node to your n8n workflow and configure the required parameters. For initial setup instructions, see our n8n Integration Guide.
Prerequisites:
- PDF4me API credentials
- n8n workflow access
Configuration:
- Add PDF4me node to workflow
- Select "Add Image Header/Footer" action
- Configure input parameters (see below)

Parameters
Complete list of parameters for the Add Image Header Footer action. Configure these parameters to control image formatting.
Important: Parameters marked with an asterisk (***) are required and must be provided for the action to function correctly.
| Parameter | Type | Description | Example |
|---|---|---|---|
| Input Data Type*** | String | Excel Input Format Selection • Choose the format of your Excel data input • PDF4me supports multiple input types • Options: Binary Data, Base64 String, or URL | Binary Data |
| Input Binary Field*** | Binary | Binary Excel File Input (Required if Binary Data) • Reference Excel file (.xlsx, .xls) from previous n8n node or file upload • PDF4me processes binary Excel files with automatic format detection • Required when Input Data Type is "Binary Data" | {{ $binary.data }} |
| Base64 Excel Content*** | String | Base64 Encoded Excel Input (Required if Base64 String) • Provide Excel content (.xlsx, .xls) as base64 encoded string • PDF4me automatically decodes and processes the Excel content • Required when Input Data Type is "Base64 String" | UEsDBBQABgAI... |
| Excel URL*** | String | Public Excel URL Input (Required if URL) • Provide a public/open permission URL to the Excel file (.xlsx, .xls) • PDF4me downloads and processes the Excel file from the provided URL • Required when Input Data Type is "URL" | https://abc.com/data.xlsx |
| Excel Name*** | String | Excel Input Filename • Specify the name of the input Excel file with proper extension (.xlsx, .xls) • PDF4me uses this for format detection and processing optimization | data.xlsx |
| Image Input Data Type*** | String | Image Input Format Selection • Choose the format of your image data input • PDF4me supports multiple input types • Options: Binary Data, Base64 String, or URL | Binary Data |
| Image Binary Field*** | Binary | Binary Image File Input (Required if Binary Data) • Reference image file (PNG, JPG, JPEG, GIF) from previous n8n node or file upload • PDF4me processes binary image files with automatic format detection • Required when Image Input Data Type is "Binary Data" | {{ $binary.logo }} |
| Base64 Image Content*** | String | Base64 Encoded Image Input (Required if Base64 String) • Provide image content (PNG, JPG, JPEG, GIF) as base64 encoded string • PDF4me automatically decodes and processes the image content • Required when Image Input Data Type is "Base64 String" | iVBORw0KGgoAAAANSUhEUg... |
| Image URL*** | String | Public Image URL Input (Required if URL) • Provide a public/open permission URL to the image file (PNG, JPG, JPEG, GIF) • PDF4me downloads and processes the image file from the provided URL • Required when Image Input Data Type is "URL" | https://abc.com/logo.png |
| Is Header | Boolean | Placement Selection • True - Add image to document header • False - Add image to document footer • Default: true • Controls vertical placement | true |
| Position | String | Horizontal Alignment • Left - Align image to left edge • Center - Center image horizontally • Right - Align image to right edge • Default: "Center" • Case-insensitive | Center |
| Worksheet Names | String | Comma-Separated Worksheet Names • List of worksheet names to apply image to • Format: "Sheet1,Summary,Report" • If both WorksheetNames and WorksheetIndexes are empty, applies to all worksheets • Worksheet names must match exactly | Sheet1,Report |
| Worksheet Indexes | String | Comma-Separated Indexes (1-based) • List of worksheet indexes (1-based numbering) • Format: "1,3,5" for first, third, and fifth sheets • If both WorksheetNames and WorksheetIndexes are empty, applies to all worksheets • Index starts at 1, not 0 | 1,2 |
| Top Margin | Number | Top Page Margin • Top page margin in centimeters • Default: 1.9 cm • Controls spacing from top edge • Affects header placement | 1.9 |
| Bottom Margin | Number | Bottom Page Margin • Bottom page margin in centimeters • Default: 1.9 cm • Controls spacing from bottom edge • Affects footer placement | 1.9 |
| Left Margin | Number | Left Page Margin • Left page margin in centimeters • Default: 1.9 cm • Controls spacing from left edge • Affects overall page layout | 1.9 |
| Right Margin | Number | Right Page Margin • Right page margin in centimeters • Default: 1.9 cm • Controls spacing from right edge • Affects overall page layout | 1.9 |
| Binary Data Output Name*** | String | Binary Data Output Mapping • Define the variable name for accessing generated Excel binary data • Used in subsequent workflow actions • Essential for workflow automation | document |
Note: If both WorksheetNames and WorksheetIndexes are empty or null, the image will be applied to all worksheets in the Excel file.
Output
Output Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| fileName | String | Excel document filename with image header/footer - The name of the output Excel document file after image header/footer addition | excel_with_image_header_footer.xlsx |
| fileSize | Number | File size in bytes - The size of the Excel document in bytes after image header/footer addition | 221849 |
| success | Boolean | PDF4me operation status - Boolean flag indicating the success or failure of the image header/footer insertion process. PDF4me returns true for successful operations and false for any errors | true |
| originalFileName | String | Original Excel document filename - The name of the input Excel document file | myExcelFile.xlsx |
| isHeader | Boolean | Header placement indicator - Indicates whether the image was placed in the header. true if placed in header, false if placed in footer | true |
| position | String | Horizontal alignment position - The horizontal alignment of the image. Values: "Left", "Center", "Right" | Center |
| worksheetNames | Array | Worksheet names array - Array of worksheet names where the image header/footer was applied | ["Sheet1"] |
| topMargin | Number | Top margin in centimeters - Top page margin value in centimeters used for header placement | 1.9 |
| bottomMargin | Number | Bottom margin in centimeters - Bottom page margin value in centimeters used for footer placement | 1.9 |
| leftMargin | Number | Left margin in centimeters - Left page margin value in centimeters | 1.9 |
| rightMargin | Number | Right margin in centimeters - Right page margin value in centimeters | 1.9 |
| message | String | Operation message - Descriptive message indicating the result of the image header/footer addition operation | Image header/footer added to Excel file successfully |
N8N Action Response
The PDF4me Add Image Header/Footer API returns a response that can be viewed in multiple formats. Choose the view that best fits your needs:
- JSON
- Table
- Schema
- Binary
JSON Response Format
The raw JSON response from the API:
[
{
"fileName": "excel_with_image_header_footer.xlsx",
"fileSize": 221849,
"success": true,
"originalFileName": "myExcelFile.xlsx",
"isHeader": true,
"position": "Center",
"worksheetNames": [
"Sheet1"
],
"topMargin": 1.9,
"bottomMargin": 1.9,
"leftMargin": 1.9,
"rightMargin": 1.9,
"message": "Image header/footer added to Excel file successfully"
}
]
Table View
Response data in a structured table format:
| Parameter | Value |
|---|---|
| fileName | excel_with_image_header_footer.xlsx |
| fileSize | 221849 |
| success | true |
| originalFileName | myExcelFile.xlsx |
| isHeader | true |
| position | Center |
| worksheetNames | ["Sheet1"] |
| topMargin | 1.9 |
| bottomMargin | 1.9 |
| leftMargin | 1.9 |
| rightMargin | 1.9 |
| message | Image header/footer added to Excel file successfully |
Schema View
The data structure and types of the response:
1 item
fileName: T excel_with_image_header_footer.xlsx
fileSize: # 221849
success: ☑ true
originalFileName: T myExcelFile.xlsx
isHeader: ☑ true
position: T Center
worksheetNames: [] Array
[0]: T Sheet1
topMargin: # 1.9
bottomMargin: # 1.9
leftMargin: # 1.9
rightMargin: # 1.9
message: T Image header/footer added to Excel file successfully
Type Indicators:
T= String (Text)#= Number☑= Boolean[]= Array
Binary Data View
The actual Excel document file data and metadata:
data
─────────────────────────────
File Name: excel_with_image_header_footer.xlsx
File Extension: xlsx
Mime Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
File Size: 221.8 kB
Binary Data Access:
- n8n Binary Object:
$binary.data.data - Base64 Content: Available for direct use
- File Operations: Ready for download, email, or storage
Use Cases
Corporate Branding and Logo Insertion
- Add company logos to Excel reports and documents automatically
- Insert branding images in headers for consistent corporate identity
- Apply client co-branding logos to deliverables and presentations
Professional Document Presentation
- Add watermark images for document security and branding
- Insert visual stamps and approval marks in document footers
- Apply professional formatting with image-based headers and footers
Automated Report Generation
- Insert logos and branding automatically in scheduled report generation
- Add visual elements to Excel reports for enhanced presentation
- Apply consistent image formatting across multiple worksheets