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