12
Views
4
Comments
[HtmlToPdfConverter_Soko.oml] CSP violates css
htmltopdfconverter-soko-oml
Web icon
Forge asset by Rodrigo Sokolosk Lima
Application Type
Traditional Web

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?

2025-07-28 06-45-20
Rupesh Patil

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

UserImage.jpg
Gokul S

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

UserImage.jpg
Gokul S

is there any solution for this?


2025-07-22 10-30-27
Mandar Deshpande

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.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.