I have a this code
<?php echo '<img border="1" src="data:image/png;base64,' . base64_encode($row['image']) . '" ;/>'; ?></br>
How do I print the img in a printer?
I have a this code
<?php echo '<img border="1" src="data:image/png;base64,' . base64_encode($row['image']) . '" ;/>'; ?></br>
How do I print the img in a printer?
The JavaScript print()
function can be called to open the print dialog in the browser. You could try adding a script element to your page that calls print:
<script type="text/javascript">print();</script>
I'm not sure how the timing would work, but you might need to do it on the onload event instead
<script type="text/javascript">
window.onload = function() {
print();
};
</script>
or perhaps a setTimeout
to delay the print call for a moment until the page is fully rendered.