• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot open the generated PDF

Hello All,
I am using DOMPDF and generating the PDF's on the fly. There is one tmp directory in the application root which has 777 chmode. I get error (some junk data gets displayed) but the PDF's are getting saved in the tmp folder and they are fine.
Where is the issue??

code in to_pdf_pi.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

* Try increasing memory available, mostly for PDF generation
function pdf_create($html, $filename, $stream=TRUE)
    $dompdf = new DOMPDF();
    $dompdf->set_paper("a4", "portrait");
    if ($stream) {
    write_file("./tmp/".$filename.".pdf", $dompdf->output());

Controller :
function PreviewFollowupReportPDF($Signofffollowup_ID,$Patient_ID,$Signoff_ID)
            $data['Signofffollowup_ID'] = $Signofffollowup_ID;

            $html = $this->load->view('patients/followupreport' ,$data,TRUE);



Also one interesting thing that i noticed is that this is an issue only in IE. All other browsers are opening the PDF well. What could be the issue??

I had a similar issue when trying to open files over an ssl connection with IE. I found it was caused by http://support.microsoft.com/kb/323308. Essentially IE doesn't play well with cache headers over ssl when you try to open a file. Not sure if it's the same issue you're having but based on your post, it's the best I can come up with.

Thanks Kamarg... but it does not happen in all applications in IE. I have one more CI application and it does open the PDF well...

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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