Hi, I'm Using this component to download pdf, but I'm not getting CSS. I know its because we enabled CSP settings. Is there a way to make this function work even CSP enabled?
hi @Gokul S
You can use this forge component for CSS:
https://www.outsystems.com/forge/component-overview/11501/ultimate-pdf-for-traditional-web-o11
I hope this helps
Thanks
Hi Rupesh
Thanks for your quick response
We have tried using that but it is not working as expected
for example
IF there is if block it prints true value of the block as well as else value
we have one table in else part it supposed to print only the table but it is taking value of true branch and prints that as well
is there any solution for this?
Hi @Gokul S
CSP blocks how the HtmlToPdfConverter loads CSS, especially when styles are inline, external, or dynamically injected. You don’t need to disable CSP, you just need to adjust how the PDF generator receives styles.
Without disabling CSP, use inline CSS safely. Instead of relying on external styles, embed CSS directly in your HTML, but avoid dynamic JS styling. This only works if CSP allows inline styles.