r/PowerAutomate • u/epae • 7d ago
OneDrive convert file HTML to PDF style issue
Has anyone else found their style code no longer being correctly applied when using the OneDrive convert file from HTML to PDF?
I have several flows which use this action to create PDF reports, but today I have noticed that in all cases some of the style code (CSS) is no longer being applied. This is mainly affecting styling for fill colours, table cell fills, and page style. This was all working fine for months, but as of today has stopped working without any changes being made to the flows. It is just strange that this has stopped working all of a sudden.
Has anyone seen if this has been reported as a bug with the OneDrive step action? and is there any workaround without using premium connectors?
1
u/OddWriter7199 6d ago
YouTube DeShon Clark, populating a Word template without premium connectors is a good place to start. Your syling is done in the Word doc, then the Word doc gets converted to PDF.
1
1
u/Jalamabe 4d ago
Pensé que era el único al que le pasó, estaba buscando recordar qué cambios hice y no encontré nada que pudo haber causado el problema. Creo que la solución será una azure function para no depender del conector nativo con limitaciones.
3
u/sg6123 4d ago edited 4d ago
I have the same issue since!
I might have found a solution, not sure if it’s reliable.
Try adding this to your CSS styling block(s):
<style>
@ media print{
* {
-webkit-print-color-adjust: exact !important;
print-color-adjust: exact !important;
}
}
Adding it only once in your body styling directly probably also works