Answer the question
In order to leave comments, you need to log in
How to fit the entire HTML area when printing?
In a pop-up window, the generated html document is sent for printing. But it is printed in chunks on 2 pages. How to fit in the whole area? So that everything fits on one sheet, regardless of the content?
Answer the question
In order to leave comments, you need to log in
Actually try:
@media print {
body {max-height: 100vh; max-width: 100vw; overflow: hidden;}
}
And how do you imagine it? In a window of 200,000 characters fit on one page? If the content is completely unknown, then nothing. If there is at least an approximate understanding of how much text can be there, then you can change the font size, for example, through vh. Something like:
@media print {
body {font-size:2vh; line-height:2vh;}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question