Tema: pdf en php
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/10/2015, 10:55
jpalcaraz
 
Fecha de Ingreso: septiembre-2015
Mensajes: 6
Antigüedad: 8 años, 7 meses
Puntos: 0
pdf en php

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