Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74158

Paper size problem when rendering subviews with blade

$
0
0

I want to generate multiple subviews with Blade files but for some reason I can not force the page size to have A5 dimensions for the printing.

This is what I've tried so far:

Menus.blade.php file receives all the data from the controllers and pass the data to each one of the subviews (menu.blade.php) :

<!DOCTYPE html>
<html>
    <head>
        <title>Daily menus</title>
    </head>
<body>
    @foreach($orders as $order)
        @include('templates.menu',$order)
    @endforeach
</body>
</html>

In the menu.blade.php file I've tried this :

<!DOCTYPE html>
<html>
    <link rel="stylesheet" href="/vendor/bootstrap/dist/css/bootstrap.min.css">

    <head>
        <meta charset="utf-8">
        <style>
            @media print{
                @page {
                    size: a5 portrait;
                    margin: 0;
                }
            }
        </style>
        <title>{{ $customerName }}</title>
    </head>
    <body>
Content...

    </body>
</html>

I really do not understant what's working..

Many thanks for the help !


Viewing all articles
Browse latest Browse all 74158

Trending Articles