CI frameworks preventing PDF from opening in Acrobat plug-in in Safari |
[eluser]Unknown[/eluser]
I've created a website that outputs PDFs and I thought all was well. Turns out that my Mac users who use Safari and the AcrobatPDFviewer plug-in can't view the generated PDFs. I use Safari and view PDFs using the built-in viewer and it works (leading to my false sense of accomplishment). After extensive testing I have determined that the PDFs are fine, and that the plug-in users can view the PDF if it is sent from a simple non-CI PHP file. As a test I copied the code from this file into a controller method. When I point the browser to this method the plug-in attempts repeatedly to access the file and never displays it. Below is the controller method I am using for testing: Code: function pdf() { I have tried it with $this->output->set_header() and the standard header() function. I tried inserting ob_clean() before the final echo statement, and using $this->output->set_output($pdf) in place of the echo statement. I've tried other variations and combinations of headers, but they have all resulted in the same failure. I am asuming that CI's handling of the buffer is changing the byte stream in a way that the Adobe plug-in does not like. Is there a way to turn off buffering so that I can simply echo the PDF directly to the output stream? Thanks for your help. Greg
[eluser]Cro_Crx[/eluser]
You could maybe try using the download helper instead of setting the headers manually ? http://ellislab.com/codeigniter/user-gui...elper.html |
Welcome Guest, Not a member yet? Register Sign In |