Convert HTML to PDF in Power Automate: 3 ways compared
Power Automate can convert HTML to PDF three ways: the free OneDrive "Convert file" action (limited fidelity), a third-party premium connector, or the HTTP action calling an HTML to PDF API for browser-grade output. The free route works for simple markup and fails on modern CSS; the other two need a Premium license. Here's how to build each, and how to know which one your documents need.
If you've already tried the OneDrive route and got a blank page or a corrupt file, you're in well-documented company: Microsoft's own Q&A boards carry threads on blank output, missing headers and footers, and corrupt PDFs. This guide explains the two failure modes behind those threads, then shows the routes that avoid them.
Key TakeawaysThe free route exists: OneDrive's "Convert file" action turns an HTML file into a PDF with no premium connector, but it renders with an Office-style engine, not a browser, so modern CSS degrades and complex pages come out blank or broken.Blank and corrupt PDFs from the OneDrive route are an engine limitation, not a flow bug; no amount of flow rework fixes markup the converter can't parse.Page numbers and repeating headers need a different route: the free conversion has no header/footer support at all.The HTTP action gives browser-grade fidelity (real Chromium via an API) but requires a Premium license, as do third-party connectors.Full flows for all three routes are below, including binary handling into SharePoint and email.
Can Power Automate convert HTML to PDF?
Yes, three ways. The built-in free route: create the HTML as a file in OneDrive, run the OneDrive "Convert file" action with PDF as the target, and store the result. For higher fidelity, use a third-party premium connector (Encodian, Plumsail, Cloudmersive) or call an HTML to PDF API directly with the HTTP action. The last two need Power Automate Premium.
Method 1: the free OneDrive convert-file trick
This is the only route that works without a Premium license, and it's genuinely useful for simple documents.
The flow:
- Create file (OneDrive for Business): write your HTML string to a file, for example
invoice.html. Compose the HTML earlier in the flow with dynamic content. - Convert file (OneDrive for Business): point it at the file you just created, target type PDF.
- Create file again (SharePoint, OneDrive) or attach to an email: the action's output is the PDF content.
- Optionally Delete file to clean up the temporary HTML.
Where it breaks
The conversion runs through an Office-style rendering engine, not a browser. In practice:
- Modern CSS degrades silently. Flexbox and grid layouts collapse or linearize; backgrounds and webfonts frequently vanish. The engine handles roughly email-grade HTML: tables, inline styles, basic formatting.
- Blank or broken pages have two causes, and only one is yours. Markup the converter can't parse fails silently (complex HTML in, empty PDF out, no error raised); the fix is simplifying the HTML. But the Q&A threads above also document service-side regressions, where flows that worked for months broke without any change on the user's end until Microsoft reverted the backend. You can't fix that class from your flow at all, which is worth knowing before you spend a day debugging one.
- No headers, footers, or page numbers. The action exposes no pagination controls at all. If your document needs "Page 1 of 4," this route can't produce it.
- Throttling: OneDrive connector limits apply, so high-volume runs need pacing.
Use it when your documents are table-based, inline-styled, and disposable-simple. The moment a designer touches the template, move on.
Method 2: third-party premium connectors
Encodian, Plumsail Documents, and Cloudmersive all publish Power Automate connectors with an HTML-to-PDF action. Drop the action in, paste HTML or a file reference, get a PDF back, no HTTP plumbing.
Two things to check before committing:
- Licensing on both sides. Third-party connectors are premium connectors, so flow owners need a Power Automate Premium license, plus the vendor's own subscription on top.
- Which engine renders your HTML. Connector docs rarely say. Output quality across these vendors ranges from browser-grade to distinctly not, and pagination/header support varies per action. Test your real template, not their sample, before subscribing.
Connectors earn their keep when your organization prefers per-vendor procurement over API keys, or when a maker team can't manage HTTP actions.
Method 3: the HTTP action + an HTML to PDF API
This is the route for documents that must look exactly like they do in a browser: designed invoices, styled reports, anything with webfonts or a modern layout. It also unlocks the features the other routes lack, page numbers included. Like Method 2, it needs a Premium license (the HTTP action is a premium action).
Building the flow
- Compose your HTML with dynamic content, or fetch it from wherever it lives.
- HTTP action: - Method: POST - URI:
https://api.transformy.io/v1/pdf/chrome- Headers:Authorization: Bearer YOUR_API_KEY,Content-Type: application/json- Body:
{
"html": "@{outputs('Compose_HTML')}",
"page_size": "A4",
"margin": "20mm 15mm",
"footer": { "html": "<span style=\"font-size:9px\">Page {{page}} of {{pages}}</span>" }
}
- Create file (SharePoint or OneDrive): File Content = the HTTP action's body. Power Automate treats the binary response correctly when you map the raw body straight into a file-content field; wrapping it in string functions is what corrupts it.
- Or attach it: in Send an email (V2), add an attachment with content set to the HTTP body and a name like
invoice.pdf.
The render happens on real headless Chromium, so what you approved in a browser tab is what lands in SharePoint; the HTML to PDF API docs cover the rest of the parameter surface (URL mode for live pages, storage delivery straight to your own bucket, async mode for big batches).
Page numbers and repeating headers
The footer and header parameters take HTML snippets with {{page}}, {{pages}}, {{date}}, and {{title}} tokens, rendered on every page. That single capability answers the most persistent Power Automate PDF question on Microsoft's forums; the free route simply has no equivalent.
Power Automate HTML to PDF licensing and cost
| Route | Power Automate license | Extra cost | Fidelity |
|---|---|---|---|
| OneDrive convert | Any (free route) | None | Email-grade HTML only |
| Third-party connector | Premium | Vendor subscription | Varies by vendor/engine |
| HTTP action + API | Premium | API plan (free tiers exist) | Browser-grade (Chromium) |
For the API column, free tiers cover real usage: Transformy's HTML to PDF API includes 100 documents a month free, and our best HTML to PDF APIs comparison lists what the rest of the market charges at volume.
FAQ
How do I convert HTML to PDF in Power Automate without a premium connector?
Use the OneDrive "Convert file" route: write the HTML to a OneDrive file, convert it to PDF, store or send the result. It's free but renders with an Office-style engine, so keep the HTML simple (tables and inline styles) and expect no headers, footers, or page numbers.
Why is my Power Automate PDF blank or corrupt?
Three causes cover most cases. Markup the OneDrive converter can't parse fails silently on modern CSS; simplify the HTML. Corrupt files often come from string-mangling the binary response, for example base64-wrapping the HTTP body before writing it; map raw file content directly into file or attachment fields. And occasionally the cause is a Microsoft service-side regression (documented in the Q&A threads above), which no flow change fixes.
How do I add page numbers to a PDF in Power Automate?
Not possible on the free route. With the HTTP action and a rendering API, pass a footer HTML snippet with {{page}} and {{pages}} tokens; the engine stamps every page. Styles in header/footer snippets must be inline.
Can Power Automate turn a live web page into a PDF?
Yes, via the HTTP action: send { "url": "https://..." } instead of an html field. Authenticated pages work too, with custom headers or cookies in the request body.
Conclusion
Match the route to the document, not the other way around:
- Simple, table-based, disposable → the free OneDrive trick. Know its blank-page failure mode before you rely on it.
- Maker teams, procurement-friendly → a premium connector, tested against your real template first.
- Designed documents, page numbers, browser fidelity → the HTTP action and a rendering API.
If you're heading down the third route, render your first PDF on Transformy's free tier: 100 documents a month, no credit card, and test keys that render real watermarked output. Paste the HTTP action config above and your flow is producing browser-grade PDFs before the next standup.