-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use other page size like 58mm? #3
Comments
Hi @chenweiyj, You can add any paper size like this in your css file: body.receipt .sheet { width: 58mm; height: 100mm } /* change height as you like */
@media print { body.receipt { width: 58mm } } /* this line is needed for fixing Chrome's bug */ Then HTML file could be like this: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>receipt</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css">
<link rel="stylesheet" href="../paper.css">
<style>@page { size: 58mm 100mm }</style>
</head>
<body class="receipt">
<section class="sheet padding-10mm">
...
</section>
</body>
</html> The point is that we need to set the |
We can also write them together in <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>receipt</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css">
<link rel="stylesheet" href="../paper.css">
<style>
@page { size: 58mm 100mm } /* output size */
body.receipt .sheet { width: 58mm; height: 100mm } /* sheet size */
@media print { body.receipt { width: 58mm } } /* fix for Chrome */
</style>
</head>
<body class="receipt">
<section class="sheet padding-10mm">
...
</section>
</body>
</html> |
really helpful for silent printing. thanks. |
Any video Tutorial |
If continuous paper printing, should I set height to auto or just not defined height?? |
I am going to print receipt used in supermarket, where its width is 58mm. How can I use this pager-css in self-defined page size?
The text was updated successfully, but these errors were encountered: