Skip to main content

Add Image Header Footer to Excel in Power Automate

PDF4me Add Image Header Footer to Excel action enables adding customizable image headers and footers to Excel documents in Power Automate with comprehensive positioning and formatting control. This powerful feature supports 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, perfect for corporate branding and professional document presentation across Microsoft 365 workflows.

Authenticating Your API Request

To access the PDF4me Web API through Power Automate, every request must include proper authentication credentials. Authentication ensures secure communication and validates your identity as an authorized user, enabling seamless integration between your Power Automate flows and PDF4me's powerful Excel formatting services.

Add Image Header Footer to Excel Power Automate

Key Features

  • Simple Image Input: Use image file content from any source in your flow
  • Header or Footer Placement: Choose whether to place images in document header or footer sections
  • Position Control: Align images left, center, or right within header/footer area
  • Worksheet Targeting: Apply images to specific worksheets by name or index, or all worksheets
  • Margin Customization: Configure top, bottom, left, and right page margins in centimeters

Parameters

Complete list of parameters for the Add Image Header Footer to Excel action. Configure these parameters to control image formatting.

Important: Parameters marked with an asterisk (***) are required.

ParameterTypeDescriptionExample
File Content***Base64Source Excel File Content
• Map Excel file from previous action output
• Supports Excel files from SharePoint, OneDrive, email attachments
• Can be dynamically retrieved from flow variables
• Must be valid Excel document (.xlsx, .xls formats)
[File Content from Get File]
File Name***StringExcel Document Name
• Specify Excel file name with extension (.xlsx, .xls)
• Used for processing and output file naming
• Must include proper file extension
• Supports dynamic naming from flow variables
data.xlsx
Image Content***Base64Source Image File Content
• Map image file from previous action output
• Supports image files from SharePoint, OneDrive, email attachments
• Can be dynamically retrieved from flow variables
• Must be valid image file (PNG, JPG, JPEG, GIF formats)
[File Content from Get File]
Is HeaderBooleanPlacement Selection
True - Add image to document header
False - Add image to document footer
• Default: true
• Controls vertical placement
true
PositionStringHorizontal Alignment
Left - Align image to left edge
Center - Center image horizontally
Right - Align image to right edge
• Default: "Center"
• Case-insensitive
Center
Worksheet NamesArray (string[])Target Worksheet Names
• Array of worksheet names to apply image to
• Example: ["Sheet1", "Summary", "Report"]
• If both WorksheetNames and WorksheetIndexes are empty, applies to all worksheets
• Worksheet names must match exactly
["Sheet1", "Report"]
Worksheet IndexesArray (int[])Target Worksheet Indexes
• Array of worksheet indexes (1-based numbering)
• Example: [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 MarginNumber (double)Top Page Margin
• Top page margin in centimeters
• Default: 1.9 cm
• Controls spacing from top edge
• Affects header placement
1.9
Bottom MarginNumber (double)Bottom Page Margin
• Bottom page margin in centimeters
• Default: 1.9 cm
• Controls spacing from bottom edge
• Affects footer placement
1.9
Left MarginNumber (double)Left Page Margin
• Left page margin in centimeters
• Default: 1.9 cm
• Controls spacing from left edge
• Affects overall page layout
1.9
Right MarginNumber (double)Right Page Margin
• Right page margin in centimeters
• Default: 1.9 cm
• Controls spacing from right edge
• Affects overall page layout
1.9

Note: FileContent, FileName, and ImageContent are always required. If both WorksheetNames and WorksheetIndexes are empty or null, the image will be applied to all worksheets in the Excel file.

Output

The PDF4me Add Image Header Footer to Excel action returns comprehensive output data for seamless Power Automate flow integration:

Table View

Response data in a structured table format:

ParameterTypeDescription
documentBase64Excel document with image header/footer applied
SuccessBooleantrue if operation successful, false if failed
Error MessageStringError description (null if successful)
ErrorsArrayList of detailed error information (empty array if successful)

Common Error Messages

Understanding and troubleshooting errors helps ensure smooth Excel image header/footer insertion workflows:

Error MessageCauseSolution
"Request is empty"Request object is nullProvide valid request object
"Document is empty"Document object is nullProvide valid Excel document
"Image content is empty"ImageContent is nullProvide valid image content from file
"Invalid worksheet selection"Worksheet names/indexes don't exist or are out of rangeUse existing worksheet names or valid indexes (1-based)
"Available worksheets in workbook (X total)"Informational message shown when worksheet selection validation failsReview worksheet names/indexes and use valid values from the X available worksheets

Workflow Examples

The PDF4me Add Image Header Footer to Excel action in Power Automate provides comprehensive workflow templates designed for real-world business scenarios:

Automated Corporate Logo Header Workflow

Transform your document branding with automated logo insertion in Excel reports:

Complete Workflow Steps:

  1. Trigger: Scheduled trigger - weekly report generation every Monday at 8 AM
  2. Get Excel Report: Retrieve weekly performance report from SharePoint
  3. Get Logo Image: Fetch company logo from SharePoint image library
  4. Add Logo Header: Insert logo image in header with center alignment
  5. Set Margins: Apply standard 1.9 cm margins for professional appearance
  6. Apply to All Sheets: Target all worksheets in the workbook
  7. Email Distribution: Send branded report to management team
  8. Archive: Store branded report in corporate reports library

Business Benefits:

  • Brands 52 weekly reports annually with corporate logo automatically
  • Ensures consistent branding across all Excel documents
  • Eliminates manual logo insertion saving 10 minutes per report
  • Enhances professional image with automated branding

Industry Use Cases & Applications

Finance & Accounting Use Cases

  • Financial Statements: Add company logo headers to quarterly reports
  • Budget Reports: Insert department logos on budget worksheets
  • Audit Documents: Apply audit firm logo watermarks in footers
  • Expense Reports: Add corporate logo headers for expense submissions

Get Help