Generate Document from HTML in Power Automate
PDF4me Generate Document from HTML action delivers powerful mail merge automation in Power Automate with batch generation of multiple personalized documents from HTML templates and structured data. This comprehensive document generation service processes data arrays to create personalized certificates, invoices, reports, and letters—transforming bulk document production and personalization workflows across Microsoft 365 ecosystem.
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 document processing services.

Key Features
- Bulk Document Generation: Create multiple personalized documents from single template
- HTML Template Support: Use HTML with CSS styling for custom layouts
- Data Merge: Combine HTML templates with JSON or XML data sources
- Batch Processing: Generate one document per data array item automatically
- Flow Integration: Process generated documents array in subsequent actions
Parameters
Complete list of parameters for the Generate Document from HTML action. Configure these parameters to control bulk document generation.
Important: Parameters marked with an asterisk (***) are required and must be provided for the action to function correctly.
| Parameter | Type | Description | Example |
|---|---|---|---|
| Template File Data*** | Binary | HTML Template Content • HTML file with merge field placeholders • Use {{fieldname}} syntax for data fields• Supports CSS styling and custom layouts • Compatible with SharePoint, OneDrive sources | [HTML Content] |
| Template File Name*** | String | HTML Template Filename • Specify filename with .html extension • Required for template identification • Supports dynamic naming from flow variables • Maintains template tracking in workflows | certificate_template.html |
| Data string*** | String | Merge Data Array (JSON or XML) • Array of data items for document generation • One document generated per array item • Supports JSON or XML format • Map from database queries or previous actions | [{"name":"John"},{"name":"Jane"}] |
Output
The PDF4me Generate Document from HTML 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 |
|---|---|---|
| Output Documents | Array of Objects | Collection of all generated documents |
| File Name | String | Individual document filename per array item |
| File Content | Binary | Individual document binary content per item |
JSON Response Format
The raw JSON response from the action:
{
"Output Documents": [
{
"File Name": "certificate_001.pdf",
"File Content": "[Binary Data]"
},
{
"File Name": "certificate_002.pdf",
"File Content": "[Binary Data]"
}
]
}
Power Automate Flow Usage
Use generated documents array in subsequent actions:
- Loop Processing: Apply to each document in Output Documents
- Email Distribution: Send each document to respective recipient
- SharePoint Storage: Upload all documents to libraries
- Batch Operations: Process generated documents in bulk
- Individual Actions: Handle each document separately
- Archive: Store complete document set systematically
Workflow Examples
The PDF4me Generate Document from HTML action in Power Automate provides comprehensive workflow templates designed for real-world business scenarios:
- Certificate Generation
- Bulk Invoice Generation
- Personalized Reports
- Mass Letter Generation
Automated Bulk Certificate Generation Workflow
Transform your credential issuance with automated HTML template certificate generation:
Complete Workflow Steps:
- Trigger: Training course completion data exported from LMS
- Get Participants: Retrieve completion list with names, dates, scores
- Prepare Data: Format participant data as JSON array
- Get Template: Retrieve HTML certificate template from SharePoint
- Generate Certificates: Create certificate PDF for each participant
- Loop Documents: Apply to each certificate in output array
- Email Individual: Send personalized certificate to each participant
- Archive All: Store all certificates in completion records library
Business Benefits:
- Generates 500+ certificates automatically per course completion
- Eliminates manual certificate creation saving 30+ hours
- Ensures consistent professional certificate formatting
- Enables instant certificate delivery to all participants
Automated Monthly Invoice Generation Workflow
Streamline your billing operations with automated HTML invoice generation:
Complete Workflow Steps:
- Trigger: Scheduled monthly billing cycle on 1st of month
- Query Billing: Retrieve customer billing data from Dynamics 365
- Prepare Array: Format billing records as JSON array
- Get Template: Retrieve branded HTML invoice template
- Generate Invoices: Create invoice PDF for each customer
- Loop Invoices: Process each invoice in output array
- Email Customer: Send personalized invoice to each customer
- Archive Invoices: Store all invoices in accounting library
Business Benefits:
- Generates 1000+ invoices automatically monthly
- Eliminates manual invoice creation entirely
- Ensures accurate billing data from ERP system
- Maintains complete invoice archive for accounting
Automated Personalized Department Report Workflow
Optimize your reporting with automated personalized HTML report generation:
Complete Workflow Steps:
- Trigger: Quarterly reporting cycle initiated
- Get Departments: Retrieve department list from organization database
- Query Performance: Get metrics for each department from BI system
- Prepare Data: Format department data and metrics as JSON array
- Generate Reports: Create personalized report for each department
- Loop Reports: Process each department report individually
- Email Manager: Send customized report to each department head
- Central Archive: Store all reports in executive library
Business Benefits:
- Creates 30+ personalized reports automatically quarterly
- Reduces report generation time by 90% with automation
- Ensures data accuracy with direct BI system integration
- Maintains centralized report repository for executives
Automated Personalized Letter Campaign Workflow
Enhance your communications with automated HTML letter generation:
Complete Workflow Steps:
- Trigger: Marketing campaign or notification event initiated
- Get Recipients: Retrieve recipient list from CRM or database
- Prepare Data: Format recipient details as JSON array
- Get Template: Retrieve personalized HTML letter template
- Generate Letters: Create letter PDF for each recipient
- Loop Letters: Process each generated letter individually
- Email Send: Deliver personalized letter to each recipient
- Print Queue: Send physical copies to print service
Business Benefits:
- Generates 2000+ personalized letters per campaign
- Reduces letter preparation time by 95% with automation
- Enables both digital and print distribution simultaneously
- Maintains campaign communication records systematically
Industry Use Cases & Applications
- Education & Training
- Finance & Accounting
- Human Resources
- Marketing & Sales
Education & Training Use Cases
- Certificate Issuance: Generate course completion certificates in bulk
- Report Cards: Create personalized student progress reports
- Enrollment Letters: Produce admission confirmation letters
- Transcripts: Generate official academic transcripts
Finance & Accounting Use Cases
- Invoice Generation: Create customer invoices in bulk
- Account Statements: Generate personalized account statements
- Tax Documents: Produce tax forms for clients
- Payment Receipts: Create transaction receipts
Human Resources Use Cases
- Offer Letters: Generate employment offer letters in bulk
- Employee Contracts: Create personalized employment agreements
- Performance Reviews: Produce individual review documents
- Benefits Statements: Generate personalized benefits summaries
Marketing & Sales Use Cases
- Personalized Proposals: Create customized sales proposals
- Customer Communications: Generate personalized campaign letters
- Event Invitations: Produce personalized event invitations
- Product Sheets: Create customized product documentation