.
This commit is contained in:
parent
e605be20f1
commit
2a5a0e041c
@ -12,8 +12,11 @@
|
||||
<script>
|
||||
document.getElementById('testPrintBtn').addEventListener('click', () => {
|
||||
fetch('/test-print', { method: 'POST' })
|
||||
.then(response => response.json())
|
||||
.then(data => alert(data.message))
|
||||
.then(response => response.blob())
|
||||
.then(blob => {
|
||||
const url = URL.createObjectURL(blob);
|
||||
window.open(url);
|
||||
})
|
||||
.catch(error => alert('Error: ' + error));
|
||||
});
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user