custom-scripts/mccs-it/thermal/public/index.html
2024-09-09 13:16:52 -04:00

35 lines
1.1 KiB
HTML

<!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>
<style>
#pdfViewer {
width: 100%;
height: 600px; /* Adjust as needed */
border: none;
}
</style>
</head>
<body>
<h1>Thermal Printer Test</h1>
<button id="testPrintBtn">Test Print</button>
<iframe id="pdfViewer" style="display:none;"></iframe>
<script>
document.getElementById('testPrintBtn').addEventListener('click', () => {
fetch('/test-print', { method: 'POST' })
.then(response => response.blob())
.then(blob => {
const url = URL.createObjectURL(blob);
const pdfViewer = document.getElementById('pdfViewer');
pdfViewer.src = url;
pdfViewer.style.display = 'block'; // Show the iframe
})
.catch(error => alert('Error: ' + error));
});
</script>
</body>
</html>