Skip to main content

Update Headers and Footers in Power Automate

PDF4me Update Headers and Footers action enables adding or modifying headers and footers in Word documents in Power Automate with comprehensive HTML content support and professional styling options. This powerful header/footer management feature supports different page layouts including first page, even/odd pages, and all pages with automatic application of professional default styling, HTML content processing, and flexible page-specific formatting, perfect for document branding, page numbering, 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 Word header/footer management services.

Update Headers and Footers Power Automate

Key Features

  • Multiple Page Types: Support for all pages, first page, even/odd pages
  • HTML Content Support: Rich HTML content with professional styling
  • Automatic Styling: Professional default styling for plain text content
  • Page Number Fields: Support for PAGE, NUMPAGES, SECTION, SECTIONPAGES
  • Flexible Layout: Different headers/footers for different page types
  • Culture Support: Locale-specific document processing
  • Format Preservation: Maintains original document structure
  • Professional Appearance: Automatic application of professional styling

Parameters

Complete list of parameters for the Update Headers and Footers action. Configure these parameters to control header and footer content and styling.

Important: Parameters marked with an asterisk (***) are required. Advanced parameters provide fine-grained control over page-specific headers and footers.

ParameterTypeDescriptionExample
File Content***Base64Source Word File Content
• Map Word file from previous action output
• Supports Word files from SharePoint, Dropbox, OneDrive, email attachments
• Can be dynamically retrieved from flow variables
• All type of file content can get from the Dropbox Get File actions
• Direct base64 can be given in the file content also
• Must be valid Word document (.docx, .doc formats)
• Headers and footers are added to this document
[File Content from Get File]
File Name***StringWord Document Name
• Specify Word file name with extension (.docx, .doc)
• Used for processing and output file naming
• Must include proper file extension
• Supports dynamic naming from flow variables
• Output filename matches input filename
document.docx
All Pages HeaderStringHeader Content for All Pages
• HTML content or plain text with default styling
• Applied to all pages in the document
• Supports page number fields: PAGE, NUMPAGES, SECTION, SECTIONPAGES
• Professional default styling applied for plain text
• Can include HTML tags for rich formatting
• Uses DocumentBuilder.InsertHtml for content insertion
• Default styling: left alignment, border-bottom, 10px font
• Primary header for consistent document branding
"<div style='text-align: center;'>Company Name</div>"
All Pages FooterStringFooter Content for All Pages
• HTML content or plain text with default styling
• Applied to all pages in the document
• Supports page number fields: PAGE, NUMPAGES, SECTION, SECTIONPAGES
• Professional default styling applied for plain text
• Can include HTML tags for rich formatting
• Uses DocumentBuilder.InsertHtml for content insertion
• Default styling: center alignment, border-top, 9px font
"Page PAGE of NUMPAGES"
First Page Header (HTML)StringHeader Content for First Page Only
• HTML content for header on first page only
• Requires DifferentFirstPageHeaderFooter to be enabled
• Useful for title pages or cover pages
• Supports HTML formatting and page number fields
• Applied only to the first page
• Processes all document sections
• Preserves existing document formatting
"<div style='text-align: center;'>Title Page</div>"
Even Pages Header (HTML)StringHeader Content for Even Pages
• HTML content for headers on even-numbered pages (2, 4, 6, etc.)
• Requires OddAndEvenPagesHeaderFooter to be enabled
• Common in book layouts
• Supports HTML formatting and page number fields
• Applied to even-numbered pages only
• Default styling: left alignment, border-bottom, 10px font
• Maintains section-specific formatting
"<div style='text-align: right;'>Book Title</div>"
Odd Pages Header (HTML)StringHeader Content for Odd Pages
• HTML content for headers on odd-numbered pages (1, 3, 5, etc.)
• Maps to AllPagesHeaderHtml in Word's structure
• Used for alternating page layouts
• Supports HTML formatting and page number fields
• Applied to odd-numbered pages only
• Professional typography with left alignment
• Ensures consistent professional appearance
"<div style='text-align: left;'>Chapter Title</div>"
First Page Footer (HTML)StringFooter Content for First Page Only
• HTML content for footer on first page only
• Requires DifferentFirstPageHeaderFooter to be enabled
• Useful for title pages or cover pages
• Supports HTML formatting and page number fields
• Applied only to the first page
• Page number fields automatically converted to Word fields
• Supports standard HTML tags and CSS styling
"<div style='text-align: center;'>Confidential</div>"
Even Pages Footer (HTML)StringFooter Content for Even Pages
• HTML content for footers on even-numbered pages
• Requires OddAndEvenPagesHeaderFooter to be enabled
• Common in book layouts
• Supports HTML formatting and page number fields
• Applied to even-numbered pages only
• Clean typography with center alignment
• Applied when content lacks comprehensive styling
"<div style='text-align: center;'>Page PAGE</div>"
Odd Pages Footer (HTML)StringFooter Content for Odd Pages
• HTML content for footers on odd-numbered pages
• Maps to AllPagesFooterHtml in Word's structure
• Used for alternating page layouts
• Supports HTML formatting and page number fields
• Applied to odd-numbered pages only
• Plain text content gets professional default styling
• Existing headers and footers are replaced with new content
"<div style='text-align: center;'>Page PAGE</div>"
Culture NameStringDocument Culture/Locale
• Culture code for document processing (e.g., "en-US", "fr-FR", "de-DE")
• Default: null (no culture-specific processing)
• Affects document language and formatting
• Use valid culture codes for international documents
• Used for metadata and localization handling
en-US

Output

The PDF4me Update Headers and Footers action returns comprehensive output data for seamless Power Automate flow integration:

Table View

Response data in a structured table format:

ParameterTypeDescription
documentBase64Word document with updated headers and footers
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 header and footer update workflows:

Error MessageCauseSolution
"Request is empty"Request object is nullProvide valid request object
"Document is empty"Document object is nullProvide valid Word document
"Error updating headers and footers"General exception during header/footer updateCheck document format and HTML content. Review exception details in Errors array
"Error loading document from bytes"Invalid or corrupted Word documentVerify the input document is a valid Word file (.docx)
"Error converting document to bytes"Error during document conversionCheck document integrity and format
"Invalid culture name provided"Invalid CultureName formatUse valid culture format (e.g., en-US, fr-FR)
"Invalid HTML content provided"Malformed HTML in header/footer contentEnsure HTML content is properly formatted
"Page number field not supported"Invalid page number field usedUse supported fields: PAGE, NUMPAGES, SECTION, SECTIONPAGES

Workflow Examples

The PDF4me Update Headers and Footers action in Power Automate provides comprehensive workflow templates designed for real-world business scenarios:

Scenario: Automatically add company branding to all documents before distribution.

Configuration:

  • All Pages Footer: "<div style='text-align: center; color: #666; font-size: 9px;'>© 2024 Company Name | Confidential</div>"

Business Value:

  • Brand Consistency: 100% of documents have consistent branding
  • Time Savings: 15 minutes per document (automated vs manual)
  • Professional Appearance: Enhanced document presentation

Workflow:

  1. Trigger: Document uploaded to SharePoint
  2. Update Headers and Footers: Add company branding
  3. Save Document: Store branded version
  4. Notify Team: Send branded document for review

Industry Use Cases & Applications

Legal Industry Use Cases

  • Contract Headers: Add confidentiality notices and legal disclaimers
  • Court Documents: Include case numbers and filing information
  • Legal Briefs: Add attorney information and case details
  • Compliance Reports: Include regulatory information and dates

Get Help