I want to print label in Laravel with data coming dynamic and i want to use LabelWriter 450 for this purpose width: 89mm; height: 41mm; how can i do that?
i try following code but it open full page for printing not according to size
<style>
@media print {
body * {
visibility: hidden;
}
.label,
.label * {
visibility: visible;
}
.label {
width: 89mm;
height: 41mm;
}
}
</style>
</head>
<body>
<div id="labelContent" class="label">
<button type="button" class="btn btn-info" id="printButton" onclick="printLabel()">Print</button>
<h3>Order ID: {{ $repair->id }}</h3>
<p>Client ID: {{ $repair->user->id }}</p>
<p>Order Date: {{ $repair->created_at->format('Y-m-d') }}</p>
<p>Fault: {{ $repair->selected_issues }}
</p>
<p>Pin/Password: {{ $repair->password }}</p>
<p>Authorize For Reset: {{ !empty($repair->authorization) ? 'Yes' : 'No' }}</p>
</div>
<script>
function printLabel() {
window.print();
}
</script>
</body>
what should i try now to print with specific width and height