Imagine that I have a web page and I want to print a receipt for the client, that clicking on a button "Print" of the page gives me the option to choose the printer to print the PICTURE that you see on the screen.
Test code:
<!DOCTYPE html>
<html lang="es">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Formulario de Login - Cliente</title>
<link rel="stylesheet" href="css/estilos_iniciar_sesion.css">
<script type="text/javascript" src="js/validar_iniciar_sesion_cliente.js"></script>
</head>
<body background="imagenes/fondo_campo2.jpg">
<form name="miformulario" id="miformulario" action="logueo_cliente.php" method="POST" class="form" onsubmit="return validar_iniciar_sesion_cliente();">
<h2>CLIENTE</h2>
<h4>INICIAR SESIÓN</h4>
<input type="text" placeholder="🔐 Usuario" name="email" id="email" tabindex="1">
<input type="password" placeholder="🔐 Contraseña" name="password" id="password" tabindex="2">
<div id="mensaje" align="center">
<?php if(isset($_GET['error']) && $_GET['error'] == 'true'): ?>
<h4><p style="color:red;">¡Sus datos no son correctos!</p></h4>
<?php endif; ?>
</div>
<div id="iniciar" align="center">
<input type="submit" value="Iniciar sesión"><br/>
<p class="form-link">¿Aún no tienes una cuenta? <a href="registrar.php">Regístrate aquí</a></p><br/>
<p class="form-link"><a href="recuperar_contrasena.php">He olvidado mi contraseña</a></p><br/><hr/><br/>
<p class="form-link"><img src="imagenes/entrar.jpg" height="10px" width="10px" alt="invitado"/> <a href="reservar.php">Entrar como invitado</a></p>
</div>
</form>
</body>
</html>
I would have to add a " PRINT " button, what would be your code to send it to a printer and print it? Is there any class?
I put this image as proof so it should be printed.