Hola, estoy haciendo una interfaz web para una raspberry, necesito abrir un pdf al hacer click en un boton.
Buscando por internet he encontrado varios ejemplos pero ninguno me funciona
Código:
$file = './path/to/the.pdf';
$filename = 'mi archivo llamado ayuda.pdf'; /* Note: Always use .pdf at the end. */
header('Content-type: application/pdf');
header('Content-Disposition: inline; filename="' . $filename . '"');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($file));
header('Accept-Ranges: bytes');
@readfile($file);
El caso es que cuando le doy al botón, se llena todo el fondo de letras, como si abriera el pdf en modo texto.
¿Que podría hacer?
Gracias