This commit is contained in:
Skylar Grant 2024-09-09 13:16:52 -04:00
parent de42b487f5
commit 91b455ebf6
1 changed files with 11 additions and 1 deletions

View File

@ -4,10 +4,18 @@
<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', () => {
@ -15,7 +23,9 @@
.then(response => response.blob())
.then(blob => {
const url = URL.createObjectURL(blob);
window.open(url);
const pdfViewer = document.getElementById('pdfViewer');
pdfViewer.src = url;
pdfViewer.style.display = 'block'; // Show the iframe
})
.catch(error => alert('Error: ' + error));
});