Welcome Guest, Not a member yet? Register   Sign In
Dompdf not working
#1

[eluser]bhakti.thakkar[/eluser]
Hello all,

there is a button on my page for creating a preview. when the user clicks the button, there is a prompt to either Open or Save the document. When a user clicks Save and then open the Saved document, it works well. But if directly clicks on open, then it generates :
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">

<h4>A PHP Error was encountered</h4>

<p>Severity: Notice</p>
<p>Message: Undefined index: dompdfuniqueid</p>
<p>Filename: include/frame.cls.php</p>
<p>Line Number: 183</p>

</div>%PDF-1.3
%âãÏÓ

1 0 obj
<< /Type /Catalog
/Outlines 2 0 R
/Pages 3 0 R
/OpenAction 8 0 R >>
endobj
2 0 obj

ETC ETC

to_pdf_pi.php

Code:
function pdf_create($html, $filename, $stream=TRUE)
{
    require_once("dompdf/dompdf_config.inc.php");
    
    $dompdf = new DOMPDF();
    $dompdf->load_html($html);
    $dompdf->render();
    if ($stream) {
        $dompdf->stream($filename.".pdf");
    } else {

         $output = $dompdf->output();
         file_put_contents('../../tmp/pdf/'.$filename.".pdf", $output);
//        write_file("./tmp/pdf/$filename.pdf", $dompdf->output());
    }
}


Controller : certificate.php
Code:
function PreviewCertificatePDF($TransactionCertificate_ID , $ITCType_TI) {
        
        $this->load->plugin('to_pdf');
        $data['TransactionCertificate_ID'] = $TransactionCertificate_ID;
        $query = $this->db->query("Exec up_parmsel_rpt_TempTransactionCertificate @TransactionCertificate_ID='$TransactionCertificate_ID' , @Company_ID='' ");
@TransactionCertificate_ID='$TransactionCertificate_ID' , @Company_ID='' ");
        $data['pgdata'] =$query->result_array();
    
             $pg="PreviewCertificate";
    
        $html = $this->load->view('certificates/'.$pg ,$data,true);


        $filename = 'TR'.$TransactionCertificate_ID."_".date('mYdHis');

        
        pdf_create($html, $filename,true);

}


What have i done wrong

Thanks in advance


Messages In This Thread
Dompdf not working - by El Forum - 02-10-2010, 03:30 AM
Dompdf not working - by El Forum - 02-10-2010, 09:11 AM
Dompdf not working - by El Forum - 02-10-2010, 11:28 PM
Dompdf not working - by El Forum - 02-11-2010, 12:32 AM
Dompdf not working - by El Forum - 02-11-2010, 01:01 AM
Dompdf not working - by El Forum - 02-11-2010, 08:26 AM
Dompdf not working - by El Forum - 02-11-2010, 12:24 PM
Dompdf not working - by El Forum - 02-11-2010, 02:07 PM
Dompdf not working - by El Forum - 02-11-2010, 11:56 PM
Dompdf not working - by El Forum - 02-11-2010, 11:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB