I have a report in html format that needs to be printed both in landscape and in portrait Can I use "@page {size: landscape / portrain}" property for individual blocks?
Asked
Active
Viewed 86 times
1
-
This should answer your question https://stackoverflow.com/questions/138422/landscape-printing-from-html – berkobienb Nov 02 '20 at 14:46
-
It does not describe the work of different blocks, personally I could only apply to the entire page – Артём Столяр Nov 02 '20 at 15:01
1 Answers
0
There is a way to hide the elements that you wouldn't want to appear in the print.
<div class="hide">
<p> Anything in here will not print</p>
</div>
And you'd add the following to your CSS:
@media print
.hide{
display:none;
}

afor94
- 21
- 3
-
I don't need to hide anything, I need to assign size: portrain for a separate container – Артём Столяр Nov 02 '20 at 15:57
-
Oh gotcha, so you want to print the page, and have the container change it's orientation just for the print? – afor94 Nov 02 '20 at 16:21
-
Yes, I can provide a screenshot so that you understand how I need to do – Артём Столяр Nov 02 '20 at 16:26
-
Would it be possible for you to add the CSS code that represents the report? – afor94 Nov 02 '20 at 17:31