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.

Related Blog Posts(5)
HTML File in Dropbox or SharePoint? Power Automate Converts It to PDF. Three Actions, That's It!
Convert HTML to PDF in Power Automate: Get file content → PDF4me HTML to PDF → Create file. No-code PDF generation from web content, invoices, reports. Works with Dropbox, SharePoint, OneDrive. Step-by-step with images.
Read post →
Convert the Email Body and Every Attachment into One Consolidated PDF in Power Automate: A 7-Step Outlook + PDF4me Workflow
Seven-step Power Automate flow. Outlook When a new email arrives (V3) trigger, Initialize variable, PDF4me Convert to PDF on the HTML body, Append to array, Apply to each over attachments (Convert to PDF plus Append), PDF4me Merge multiple PDF files, Dropbox Create file with a timestamped name. Every incoming email becomes one PDF carrying the body and every attachment, in order. Real screenshots, exact expressions, two sample DOCX attachments and the merged output all downloadable.
Read post →
Turn Every Inbound Email Into an Audit-Ready PDF Archive in Power Automate: A 7-Step Outlook Workflow
Seven-step Power Automate flow for records management and audit teams. Outlook When a new email arrives V3 trigger, PDF4me converts the HTML body to PDF, every attachment is converted in parallel, PDF4me Merge stitches body plus attachments into one timestamped PDF, Dropbox stores it for compliance retention. Real screenshots, exact expressions, sample DOCX attachments downloadable, the merged archive PDF reproducible.
Read post →

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.

ParameterRequiredWhat it doesExample
File ContentRequiredContent of the HTML file, or of a ZIP archive containing the HTML page and its assets (images, stylesheets). Map it from the file content returned by a previous action.[File Content from Get File]
HTML File NameRequiredName of the HTML file or ZIP archive, including its extension (for example `page.html` or `site.zip`).template.html
Index File PathOptionalWhen the file is a ZIP archive, the path of the HTML page inside it to convert, for example `site/index.html`. Required for ZIP input.site/index.html
Page LayoutOptionalPage orientation of the PDF. Options: , Portrait, Landscape. Defaults to `Portrait`.Portrait
Page SizeOptionalPaper size of the PDF pages. Options: , Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6. Defaults to `A4`.A4
ScaleOptionalZoom factor applied to the page content, for example `0.8` for 80%. Defaults to `0.8`.0.8
Top MarginOptionalTop page margin, as a length with a unit (for example `40px`). Defaults to `40px`.40px
Bottom MarginOptionalBottom page margin, as a length with a unit (for example `40px`). Defaults to `40px`.40px
Left MarginOptionalLeft page margin, as a length with a unit (for example `40px`). Defaults to `40px`.40px
Right MarginOptionalRight page margin, as a length with a unit (for example `40px`). Defaults to `40px`.40px
Print BackgroundOptionalDisplay background images. Defaults to `Yes`.Yes

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:

FieldTypeWhat it contains
File ContentFile contentContent of the resulting PDF. Map it into the next action, for example the File Content field of SharePoint or OneDrive Create file.
File NameTextFile name of the resulting PDF, as returned by PDF4me. Use it as the file name when saving the file.
Page CountTextPage count reported by PDF4me for the processed document. Returned as text; wrap it in int() to use it as a number.

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​