webgio / Rotativa

Rotativa, /rota'tiva/. Make Pdf from Asp.Net MVC. Available on Nuget https://www.nuget.org/packages/Rotativa
http://letsfollowtheyellowbrickroad.blogspot.it/search/label/Rotativa
MIT License
621 stars 224 forks source link

Rotativa on HTTPS not loading the css #234

Closed BGMOmar closed 1 year ago

BGMOmar commented 1 year ago

Hello so i was generating view as pdf in my website with http link and it was working when i moved into https the pdf is loading but it its not loading the css , i have the css link in the head as : <link rel="stylesheet" href="/css/style.css"> Tried using other styles like using the ~ or Url.Content or even using the https://mydomain/css/... but didn't want to work any ideas ?

MarteFilho commented 1 year ago

I have the same problem here, it works locally and in docker container. In azure with the same image and configuration doesnt work. I have tried @Url.Content, "~", @Url.Content(System.IO.Path.Combine(Environment.WebRootPath, "RotativaAssets", "css", "style.css")) but none works.

BGMOmar commented 1 year ago

@MarteFilho I actually found a work around to make it work , the problem for me was on the server had to add the domain and its ip adress in the hosts.txt file on the windows server.