I'm trying to create a pdf which uses css to completely style the background-color. I can't seem to get the css to give it a full background.
My CSS:
@media print {
@page {
background: pink !important; // not showing
margin: 0 !important;
padding: 0 !important;
-webkit-print-color-adjust: exact !important;
}
}
html, body {
box-sizing: border-box;
min-height: 100%;
min-width: 100%;
height: 100%;
width: 100%;
font-family: Montserrat;
background-color: #20333e;
color: rgba(255, 255, 255, 0.87);
border: 2px solid red;
}
Which outputs:
I already have the markdown data in json format and am using the package markdown-pdf to create the pdf.
import * as markdownpdf from 'markdown-pdf';
markdownpdf({cssPath: './path/to/my/ebook.css'}).from.string('# CSS Not Full Background').to("./document.pdf", function () {
console.log("done");
});
How can I style my pdf to have a full background?