• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Problem with R&OS;PDF creator: Lost headers

#3
[eluser]sl3dg3hamm3r[/eluser]
okay, after playing around I figured out that it was a classical output before header, because I was simply echoing the pdf-stream in my library. d'oh!

That's how it should be used correctly:
Code:
$this->CI->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");                     // some day in the past to avoid cached files
$this->CI->output->set_header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
$this->CI->output->set_header("Content-type: application/pdf");                                  // It is a pdf...
$date = gmdate("d.m.Y") . "_" . date("H_i");
$this->CI->output->set_header("Content-Disposition: attachment; filename=".$fileName."_".$date.".pdf");
$this->CI->output->set_header("Content-Transfer-Encoding: binary");
$pdfStream = $this->CI->cezpdf->ezOutput();
$this->CI->output->set_output($pdfStream);

It is then in the hands of CI to set the headers and send the content after!

By the way: If you don't want to set your headers yourself, you can use
Code:
$this->CI->cezpdf->ezStream();
The pdf-library will set some standard-headers itself. But note, they can't be overwritten anymore since the output will be also echoed straight away by the library.


Messages In This Thread
[SOLVED] Problem with R&OS;PDF creator: Lost headers - by El Forum - 07-01-2009, 12:33 PM
[SOLVED] Problem with R&OS;PDF creator: Lost headers - by El Forum - 07-02-2009, 03:40 AM
[SOLVED] Problem with R&OS;PDF creator: Lost headers - by El Forum - 07-03-2009, 09:39 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.