I did some experiments and I noticed that if you insert in the @media print {) portion, the lines of code from the “clean-embeds-all.css” file, you even get a quite nice pdf.
Other useful lines to avoid page breaks are:
/* Page breaks */
h1 {
page-break-before: always;
}
h2, h3, h4, h5, h6 {
page-break-after: avoid;
}
pre, blockquote {
page-break-inside: avoid;
}