Is there a way to vertically center the container if it hits a new page when printing?
As you can see from the diagram, container A may become too large for A and B to occupy their own pages. When this happens, I want B or both to be centered.
+----------------+ +----------------+ +----------------+ | +------------+ | | | | | | | | | | +------------+ | | | | | A | | | | | | | | | | | | | | | | | +------------+ | | +------------+ | | | | | | | | | | | +---> | | A | | | | B | | | +------------+ | | | | | | | | | | | | | | | | | | +------------+ | | | B | | | | | | | | | | | | | +------------+ | | | | +------------+ | | | | | +----------------+ +----------------+ +----------------+
We use wkhtmltopdf to create PDF files. In our case, printing from PDF is enough. But as far as I know, wkhtmltopdf does not support this concentration. So I'm wondering if this can be done using css and / or javascript.
One idea is to calculate the height of the container and set the corresponding top edge in JS. But this requires knowledge of when / if the container moves to the next page, I guess?
source share