nestjs-pdf
nestjs-pdf copied to clipboard
CSS don't load
I can't load my css
Project structure
src/
templates/
index/
css/
style.css
html.hbs
app.module.ts
PDFModule.register({
isGlobal: true,
view: {
root: join(__dirname, '..', 'templates'),
engine: 'handlebars',
extension: 'hbs',
},
}),
html.hbs
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<h1 class="red">Hello World</h1>
</body>
</html>
style.css
.red {
color: red;
}
@ismailkoksal Did you solve this?
@ismailkoksal Did you solve this?
@dacxjo No, i decided to put CSS in the HBS file.
HI,
this is working for me:
> root/
> assets/
> stylesheets/
> style.css
file.pug:
head
meta(charset="UTF-8")
meta(name="viewport", content="width=device-width, initial-scale=1.0")
style
include ../stylesheets/style.css
Thanks but I have uninstalled this package, instead, I'm using puppeteer with his pdf method to generate my documents