meke dakunu paththe spacing eka ain krnne kohomd cuddah ?
me printer eka use karanne epson tm-t81iii
Macos eken print krnne Printer driver ehm dala tynne
Laravel walin haduwe
PHP:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Invoice Print</title>
<?php
// Start output buffering to capture the style
ob_start();
?>
<style>
* {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
box-sizing: border-box;
}
body, html {
/* width: 80mm; */
margin: 0;
padding: 0;
}
/* .invoice-wrapper {
width: 80mm;
padding: 10px;
} */
h3 {
margin: 0;
font-size: 18pt;
}
p {
margin: 2px 0;
font-size: 13pt;
line-height: 12pt;
}
p.text-center:last-child { /* Target the last text-center element */
margin-bottom: 0;
}
table {
width: 100%;
border-collapse: collapse;
margin-bottom: 5px;
}
table td {
font-size: 12pt;
line-height: 15pt;
}
.text-center {
text-align: center;
}
.text-right {
text-align: right;
}
.btn-print {
display: none;
}
.dev {
font-size: 10pt;
}
@media print {
body, html {
/* width: 80mm; */
margin: 0 auto;
padding: 0;
overflow: hidden;
}
/* .invoice-wrapper {
width: 80mm;
margin: 0 ;
padding-left: 15px;
} */
@page {
margin: 0;
size: 80mm auto;
}
}
</style>
<?php
// Output the captured style
echo ob_get_clean();
?>
</head>
<body onload="window.print()">
<!-- <div class="invoice-wrapper"> -->
<div class="text-center">
<h3 style="margin-bottom: 5px;">Walathara Spa</h3>
<p>www.thewalathara.com</p>
<p>011 5547 400</p>
<p>Panadura Srilanka</p>
</div>
<br>
<div style="display: flex; justify-content: space-between;">
<p><?php echo htmlspecialchars(date('d-m-Y')); ?></p>
<p><?php echo htmlspecialchars(strtoupper(auth()->user()->name)); ?></p>
</div>
<p>No: <?php echo htmlspecialchars($transaction->transaction_code); ?></p>
<p class="text-center">================================</p>
<br>
<table>
<?php foreach ($transaction->transaction_details as $transaction_detail): ?>
<tr>
<td colspan="3"><?php echo htmlspecialchars($transaction_detail->name); ?></td>
</tr>
<tr>
<td><?php echo htmlspecialchars($transaction_detail->qty); ?> x <?php echo htmlspecialchars($transaction_detail->base_price); ?></td>
<td></td>
<td class="text-right"><?php echo htmlspecialchars($transaction_detail->qty * $transaction_detail->base_price); ?></td>
</tr>
<?php endforeach; ?>
</table>
<p class="text-center">================================</p>
<table>
<tr>
<td>Total :</td>
<td class="text-right"><?php echo htmlspecialchars($transaction->total_price); ?></td>
</tr>
<tr>
<td>Accept:</td>
<td class="text-right"><?php echo htmlspecialchars($transaction->accept); ?></td>
</tr>
<tr>
<td>Return:</td>
<td class="text-right"><?php echo htmlspecialchars($transaction->return); ?></td>
</tr>
</table>
<p class="text-center">================================</p>
<!-- </div> -->
<div class="text-center">
<!-- <img src="{{ asset('images/qr.svg') }}" alt="QR Code" style="max-width: 25%; height: auto;"> -->
</div>
<p class="text-center">-- Review us --</p>
<p class="text-center">-- Come again --</p>
<p class="text-center dev">Software by: Walathara colu</p>
<script>
document.addEventListener('DOMContentLoaded', (event) => {
let body = document.body;
let html = document.documentElement;
let height = Math.max(
body.scrollHeight, body.offsetHeight,
html.clientHeight, html.scrollHeight, html.offsetHeight
);
document.cookie = "innerHeight=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
document.cookie = "innerHeight=" + ((height + 50) * 0.264583);
});
</script>
</body>
</html>
