custom-scripts/mccs-it/thermal/public/index.html

25 lines
720 B
HTML
Raw Normal View History

2024-09-06 23:26:30 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test Print</title>
</head>
<body>
<h1>Thermal Printer Test</h1>
<button id="testPrintBtn">Test Print</button>
<script>
document.getElementById('testPrintBtn').addEventListener('click', () => {
fetch('/test-print', { method: 'POST' })
2024-09-09 17:11:53 +00:00
.then(response => response.blob())
.then(blob => {
const url = URL.createObjectURL(blob);
window.open(url);
})
2024-09-06 23:26:30 +00:00
.catch(error => alert('Error: ' + error));
});
</script>
</body>
</html>