Reputation: 105
We have a printer-friendly version of a web page that we want to print. The problem is we want it to print on a 4"*6" size paper by default.
Is this possible?
Upvotes: 4
Views: 21330
Reputation: 49
Yes, we can.
Just add this css and page size will be adjusted in mm .
@page {
size: 80mm 170mm;
}
If you are using Angular or React etc., then you can add this CSS in respective component.
Upvotes: 0
Reputation: 751
You can set Paper size using CSS
:
@page {
size: auto;
size: A3;
margin: 0mm;
}
Upvotes: 4
Reputation: 288
What you could try is to put everything in a div with certain width, given in mm
or in
. Printing this will not select a certain paper size, but it will guarantee to fit, widthwise that is.
Upvotes: 5