Skip to main content

HTML to PDF in Power Automate

PDF4me HTML to PDF action converts HTML content and files to professional PDF documents in Power Automate with advanced rendering capabilities. This versatile conversion feature supports single HTML files, ZIP archives with HTML and assets, custom layouts, and preserves CSS styling, images, and formatting, perfect for creating reports, invoices, certificates, and documents from web content 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 HTML to PDF conversion services.

HTML to PDF Power Automate

Key Features

  • HTML File Support: Convert single HTML files or ZIP archives with assets
  • CSS Preservation: Maintain all styling and formatting from HTML
  • Image Embedding: Include images and graphics in converted PDFs
  • Custom Layouts: Control page size and layout options
  • Dynamic Content: Convert dynamically generated HTML to PDF

Parameters

Complete list of parameters for the HTML to PDF action. Configure these parameters to control HTML conversion.

Important: Parameters marked with an asterisk (***) are required and must be provided for the action to function correctly.

ParameterTypeDescriptionExample
File Content***BinaryHTML File Content
• Map HTML file content from previous action
• Supports single HTML or HTML files in ZIP
• ZIP should contain HTML and referenced assets
• Can include CSS, JavaScript, images
[File Content from Get File]
HTML File Name***StringHTML File Name
• Specify HTML file name to convert
• Should include .html or .zip extension
• For ZIP, this is the entry point file
• Used for conversion processing
template.html
File NameStringIndex File Path
• Index file path required when input is ZIP
• Specifies main HTML file within ZIP archive
• Relative path from ZIP root
• Example: index.html or main.html
index.html
Layout***OptionPage Layout Format
Portrait - Vertical page orientation
Landscape - Horizontal page orientation
• Controls output PDF page dimensions
• Must specify value
Portrait

Output

The PDF4me HTML to PDF action returns comprehensive output data for seamless Power Automate flow integration:

Table View

Response data in a structured table format:

ParameterTypeDescription
File ContentBinaryConverted PDF file with rendered HTML content
PDF ContentStringText content extracted from converted PDF

Workflow Examples

The PDF4me HTML to PDF action in Power Automate provides comprehensive workflow templates designed for real-world business scenarios:

Automated HTML Report to PDF Workflow

Transform your reporting with HTML template to PDF conversion:

Complete Workflow Steps:

  1. Trigger: Scheduled trigger - monthly reporting on 1st at 9 AM
  2. Get Data: Query database for monthly metrics and KPIs
  3. Get HTML Template: Retrieve report HTML template from SharePoint
  4. Populate Template: Inject data into HTML template placeholders
  5. Convert to PDF: Transform populated HTML to PDF
  6. Add Branding: Apply company watermark and headers
  7. Email Distribution: Send PDF report to stakeholder list
  8. Archive Report: Store in SharePoint reports library

Business Benefits:

  • Generates 50+ HTML-based reports monthly automatically
  • Enables rich formatting with HTML/CSS capabilities
  • Reduces report generation time from 4 hours to 10 minutes
  • Maintains consistent professional appearance

Industry Use Cases & Applications

Sales & Marketing Use Cases

  • Proposals: Convert HTML proposals to PDF for client delivery
  • Marketing Materials: Transform HTML designs to PDF brochures
  • Email Campaigns: Archive HTML email campaigns as PDFs
  • Reports: Generate sales reports from HTML templates

Get Help