Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join now60 Days of Data Days! Live and on-demand sessions, challenges, study groups and more! And it's all FREE!. Join now. Learn more
Hi
I'm currently looking for a technique to convert HTML files stored in a Microsoft Fabric Lakehouse into PDF files.
The goal is to preserve both the content and the original formatting/layout as accurately as possible.
I initially tried using xhtml2pdf, but the HTML files contain a large embedded CSS stylesheet (Bootstrap-like grid, media queries, advanced selectors such as :not() and attribute selectors). This resulted in CSS parsing errors. After removing the styling, the PDF could be generated successfully, but most of the original layout was lost.
I also evaluated:
Since preserving the layout is a hard requirement, I'm looking for recommendations from anyone who has implemented HTML-to-PDF conversion in Microsoft Fabric while maintaining browser-quality rendering.
Thanks in advance for any suggestions.
Solved! Go to Solution.
@ArneVer
AS per my understanding and findings, Fabric runs in managed environment so there is no built in fabric API that converts HTML to PDF.
Workaround for this problem:
Fabric NoteBook ---->(Read HTML from Lakehouse) ----> Azure Function (PlayWrtie +Chromium) ----> Convert HTML to PDF ----> Save PDF to ADSL /OneLake
2nd Option similar approach but use Power Auomate Flow instead Azure Function.
Lakehouse ----> Power Automate ---->HTML to PDF converter ---->Onelake / Sharepoint
Please let me know how this goes on.
If this helps, ✓ Mark as Kudos | Help Others
Hi @User, Preserving the original HTML layout (especially with complex CSS frameworks like Bootstrap) typically requires a browser-based rendering engine. Libraries such as xhtml2pdf are suitable for simple HTML but often struggle with modern CSS features. Based on your findings, here are a few approaches you could consider:
Unfortunately, Fabric Notebooks currently don't expose the OS-level dependencies required by tools such as WeasyPrint, nor are they designed to run headless Chromium reliably. Because of this, browser-based rendering directly inside Fabric isn't officially supported today. For more information:
Could you also clarify:
This information will help determine the most suitable and scalable approach for your scenario. |
💡 Helpful? Give a Kudos 👍 — keep the community growing.✅ Solved your issue? Mark this as the Accepted Solution ✔️Best regards, |
Hi @User, Preserving the original HTML layout (especially with complex CSS frameworks like Bootstrap) typically requires a browser-based rendering engine. Libraries such as xhtml2pdf are suitable for simple HTML but often struggle with modern CSS features. Based on your findings, here are a few approaches you could consider:
Unfortunately, Fabric Notebooks currently don't expose the OS-level dependencies required by tools such as WeasyPrint, nor are they designed to run headless Chromium reliably. Because of this, browser-based rendering directly inside Fabric isn't officially supported today. For more information:
Could you also clarify:
This information will help determine the most suitable and scalable approach for your scenario. |
💡 Helpful? Give a Kudos 👍 — keep the community growing.✅ Solved your issue? Mark this as the Accepted Solution ✔️Best regards, |
Hi @ArneVer,
Thank you for posting your query in the Microsoft Fabric Community Forum, and thanks to @Kagiyama_yutaka & @Murtaza_Ghafoor for sharing valuable insights.
Could you please confirm if your query has been resolved by the provided solutions? This would be helpful for other members who may encounter similar issues.
Thank you for being part of the Microsoft Fabric Community.
Fabric Lakehouse and Notebooks do not provide any built‑in HTML→PDF, so the safe way is to read the HTML out of the Lakehouse and convert it to PDF in another environment (for example a normal browser’s “Print → Save as PDF” or an external HTML‑to‑PDF service).
@ArneVer
AS per my understanding and findings, Fabric runs in managed environment so there is no built in fabric API that converts HTML to PDF.
Workaround for this problem:
Fabric NoteBook ---->(Read HTML from Lakehouse) ----> Azure Function (PlayWrtie +Chromium) ----> Convert HTML to PDF ----> Save PDF to ADSL /OneLake
2nd Option similar approach but use Power Auomate Flow instead Azure Function.
Lakehouse ----> Power Automate ---->HTML to PDF converter ---->Onelake / Sharepoint
Please let me know how this goes on.
If this helps, ✓ Mark as Kudos | Help Others
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 18 | |
| 17 | |
| 13 | |
| 11 | |
| 10 |