printThis icon indicating copy to clipboard operation
printThis copied to clipboard

My css not loading

Open mauriciolanini opened this issue 3 years ago • 6 comments

I have this page and I need to convert it to pdf image But I have the following return image My code is this: image Where there may be an error for not loading the css correctly? Thaks!

mauriciolanini avatar Sep 03 '22 01:09 mauriciolanini

Try using the full path to the CSS file. printThis creates an iframe and that iframe can't use relative paths, so a fully qualified URL to the CSS is needed.

jasonday avatar Sep 03 '22 03:09 jasonday

I edited the code to the full path, but it still presents the same way as above image image

I need to add some more properties?

ghost avatar Sep 03 '22 03:09 ghost

To reference files on your hard drive, you may need to do the following:

file:///C:/mystyles.css

But if you're using localhost then it would be something like:

http://localhost:8080/mystyles.css

jasonday avatar Sep 03 '22 03:09 jasonday

The command prompt calls css. But in the pdf it is still different from the website image image image image

ghost avatar Sep 03 '22 13:09 ghost

In this configuration I still get the same output

image image

ghost avatar Sep 03 '22 13:09 ghost

Hello I solved loading the style inside the html div. Thank you for your help!

ghost avatar Sep 03 '22 15:09 ghost