I am using wkhtmltopdf 0.12.3.2 on Windows.
I know there are a lot of questions and answers around this topic, but I still can't find an answer to my problem; I don't know where to put the according CSS - or the CSS doesn't work for some (other) reason:
for example i tried to put the page-break related CSS directly into my html file which i want to render. i tried to force page-breaks with <span class="break_here"></span>
in my <body>
:
<!-- ... -->
<head>
<style>
span.break_here {
page-break-after: always !important;
}
</style>
</head>
<!-- ... -->
this didn't do anything.
then i also tried to put it into @media print{}
or @media screen{}
which did not change anything either:
<style>
@media screen{
span.break_here {
page-break-after: always !important;
}
}
</style>
thanks for any help!
edit: there is even another possibility by adding the --user-style-sheet
option for using an external stylesheet.