Jump to content

Factura PDF en blanco


Recommended Posts

Hola,

 

tengo un problema con prestashop.

Tengo la ultima version 1.5.4.1 instalada y todo va perfecto hasta que intento generar las facturas.

 

Tanto en el front como en el backoffice al descargar la factura me sale la pagina wn blanco.

 

He activado la depuracion de errores y me sale esto:

 

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ')' in /var/www/vhost/XXXXXXXXXX.com/home/html/tools/tcpdf/tcpdf.php on line 9024

 

Lo que corresponde a la line 9024 es esto:

 

header('Content-Type: application/force-download');

 

El codigo de la linea 8987 a la 9037

 

  case 'FD': {
// save PDF to a local file
if ($this->diskcache) {
 copy($this->buffer, $name);
} else {
 $f = fopen($name, 'wb');
 if (!$f) {
  $this->Error('Unable to create output file: '.$name);
 }
 fwrite($f, $this->getBuffer(), $this->bufferlen);
 fclose($f);
}
if ($dest == 'FI') {
 // send headers to browser
 header('Content-Type: application/pdf');
 header('Cache-Control: private, must-revalidate, post-check=0, pre-check=0, max-age=1');
 //header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1
 header('Pragma: public');
 header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past
 header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
 header('Content-Disposition: inline; filename="'.basename($name).'"');
 $this->sendOutputData(file_get_contents($name), filesize($name));
} elseif ($dest == 'FD') {
 // send headers to browser
 if (ob_get_contents()) {
  $this->Error('Some data has already been output, can\'t send PDF file');
 }
 header('Content-Description: File Transfer');
 if (headers_sent()) {
  $this->Error('Some data has already been output to browser, can\'t send PDF file');
 }
 header('Cache-Control: private, must-revalidate, post-check=0, pre-check=0, max-age=1');
 header('Pragma: public');
 header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past
 header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
 // force download dialog
 if (strpos(php_sapi_name(), 'cgi') === false) {
  header('Content-Type: application/force-download');
  header('Content-Type: application/octet-stream', false);
  header('Content-Type: application/download', false);
  header('Content-Type: application/pdf', false);
 } else {
  header('Content-Type: application/pdf');
 }
 // use the Content-Disposition header to supply a recommended filename
 header('Content-Disposition: attachment; filename="'.basename($name).'"');
 header('Content-Transfer-Encoding: binary');
 $this->sendOutputData(file_get_contents($name), filesize($name));
}
break;
  }

 

estoy ya un poco desesperado porque no tengo ni idea de que puede ser.

Me ayudais?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...