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.

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.
| Parameter | Type | Description | Example |
|---|---|---|---|
| File Content*** | Base64 | Source 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*** | String | Word 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 Header | String | Header 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 Footer | String | Footer 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) | String | Header 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) | String | Header 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) | String | Header 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) | String | Footer 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) | String | Footer 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) | String | Footer 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 Name | String | Document 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
- JSON
- Flow Integration
Table View
Response data in a structured table format:
| Parameter | Type | Description |
|---|---|---|
| document | Base64 | Word document with updated headers and footers |
| Success | Boolean | true if operation successful, false if failed |
| Error Message | String | Error description (null if successful) |
| Errors | Array | List of detailed error information (empty array if successful) |
JSON Response Format
The raw JSON response from the action:
{
"document": "[Base64 Word Content with Updated Headers and Footers]",
"Success": true,
"ErrorMessage": null,
"Errors": []
}
Error Response Example:
{
"document": null,
"Success": false,
"ErrorMessage": "Error updating headers and footers",
"Errors": [
{
"Code": "HEADER_FOOTER_ERROR",
"Message": "Invalid HTML content provided"
}
]
}
Power Automate Flow Usage
Use documents with updated headers and footers in subsequent actions:
- Document Branding: Apply consistent company branding to all documents
- Page Numbering: Add professional page numbering to reports
- Legal Compliance: Add required disclaimers and legal notices
- Document Distribution: Send professionally formatted documents to stakeholders
- Archive Management: Store documents with proper headers and footers
- SharePoint Publishing: Upload formatted documents to document libraries
Common Error Messages
Understanding and troubleshooting errors helps ensure smooth header and footer update workflows:
| Error Message | Cause | Solution |
|---|---|---|
| "Request is empty" | Request object is null | Provide valid request object |
| "Document is empty" | Document object is null | Provide valid Word document |
| "Error updating headers and footers" | General exception during header/footer update | Check document format and HTML content. Review exception details in Errors array |
| "Error loading document from bytes" | Invalid or corrupted Word document | Verify the input document is a valid Word file (.docx) |
| "Error converting document to bytes" | Error during document conversion | Check document integrity and format |
| "Invalid culture name provided" | Invalid CultureName format | Use valid culture format (e.g., en-US, fr-FR) |
| "Invalid HTML content provided" | Malformed HTML in header/footer content | Ensure HTML content is properly formatted |
| "Page number field not supported" | Invalid page number field used | Use 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:
- Document Branding
- Report Page Numbering
- Legal Document Headers
- Multi-Section Document Layout
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:
- Trigger: Document uploaded to SharePoint
- Update Headers and Footers: Add company branding
- Save Document: Store branded version
- Notify Team: Send branded document for review
Scenario: Add professional page numbering to monthly reports.
Configuration:
- All Pages Footer:
"<div style='text-align: center;'>Page PAGE of NUMPAGES</div>"
Business Value:
- Professional Standards: Consistent page numbering across all reports
- Efficiency: Automated page numbering for all documents
- Quality Assurance: Eliminates manual numbering errors
Workflow:
- Trigger: Monthly report generated
- Update Headers and Footers: Add page numbering
- Quality Check: Verify page numbers
- Distribution: Send to stakeholders
Scenario: Add legal disclaimers and confidentiality notices to legal documents.
Configuration:
- All Pages Footer:
"<div style='text-align: center; font-size: 8px; color: #999;'>CONFIDENTIAL - Attorney-Client Privilege</div>"
Business Value:
- Compliance: Ensures all legal documents have required disclaimers
- Risk Mitigation: Reduces legal liability through proper documentation
- Consistency: Standardized legal document formatting
Workflow:
- Trigger: Legal document created
- Update Headers and Footers: Add legal disclaimers
- Review: Legal team verification
- Archive: Store in secure location
Scenario: Create professional book-style layout with different headers for odd/even pages.
Configuration:
- Odd Pages Header:
"<div style='text-align: left;'>Chapter Title</div>" - Even Pages Header:
"<div style='text-align: right;'>Book Title</div>" - All Pages Footer:
"<div style='text-align: center;'>Page PAGE</div>"
Business Value:
- Professional Layout: Book-quality document formatting
- Reader Experience: Enhanced navigation and readability
- Brand Consistency: Professional document presentation
Workflow:
- Trigger: Book manuscript ready
- Update Headers and Footers: Apply book-style layout
- Review: Editorial team verification
- Publishing: Prepare for publication
Industry Use Cases & Applications
- Legal Industry
- Finance & Banking
- Healthcare
- Education
- Manufacturing
- Government
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
Finance & Banking Use Cases
- Financial Reports: Add company information and report dates
- Audit Documents: Include auditor information and report numbers
- Regulatory Filings: Add regulatory compliance information
- Investment Documents: Include risk disclaimers and legal notices
Healthcare Use Cases
- Medical Reports: Add patient confidentiality notices
- Research Documents: Include study information and ethics approval
- Clinical Trials: Add protocol numbers and investigator information
- Compliance Documentation: Include regulatory information and dates
Education Use Cases
- Academic Papers: Add institution information and course details
- Research Reports: Include funding information and acknowledgments
- Student Records: Add academic year and semester information
- Administrative Documents: Include department and contact information
Manufacturing Use Cases
- Technical Manuals: Add version information and revision dates
- Quality Documents: Include quality control information and standards
- Safety Procedures: Add safety warnings and compliance information
- Training Materials: Include course information and completion tracking
Government Use Cases
- Policy Documents: Add department information and effective dates
- Regulatory Documentation: Include regulation numbers and compliance dates
- Public Records: Add agency information and record numbers
- Legislative Documents: Include bill numbers and session information