I\'ve to print out 2 html pages in a web-app. The first page must be printed out in A5 size , the second in A4 size. I tried to force the
Using this media query content will adjust for A5
.
@media print
{
@page
{
size: 8.5in 11in;
}
}
You could uset paper-css library as it will help you easily define the paper size by paper-css lib load the css file
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/paper-css/0.3.0/paper.css">
then set the style in the <head>
part
<style>@page { size: A5 }</style>
then set the body class to A5
like the following
<!-- Set "A5", "A4" or "A3" for class name -->
<!-- Set also "landscape" if you need -->
<body class="A5">
<!-- Each sheet element should have the class "sheet" -->
<!-- "padding-**mm" is optional: you can set 10, 15, 20 or 25 -->
<section class="sheet padding-10mm">
<!-- Write HTML just like a web page -->
<article>This is an A5 document.</article>
</section>
</body>
for more information follow the link below https://github.com/cognitom/paper-css