I have my website installed inside subdirectory.
I noticed that the function function invoice_view_pdf($invoice_number) (line 831 invoice.module ) produced error 500 after calling new DOMPDF() . I added the following line spl_autoload_register('DOMPDF_autoload'); and the problem solved ( See also at http://codeigniter.com/forums/viewthread/86724/ ). The final code is :

function invoice_view_pdf($invoice_number) {
  // include the dompdf library
  _invoice_dompdf_include_lib();
  spl_autoload_register('DOMPDF_autoload');  // I dont' know what is doing this line but is solved my problem 
  $nid = db_result(db_query("SELECT nid FROM {invoice_invoices} WHERE iid=%d", $invoice_number));
  $node = node_load($nid);
  $html = _invoice_get_html($invoice_number, $node, 'pdf');
  $dompdf = new DOMPDF();
  $dompdf->load_html($html);
  $dompdf->render();
  $dompdf->stream(t('invoice') .'-'. $node->invoice['formatted_invoice_number'] .".pdf", array('Attachment' => 1));
}

Comments

tinflute’s picture

Beautiful! I had the same problem and this line fixed it like a charm.
Perhaps consider submitting it as a patch eh.

pietervogelaar’s picture

Status: Active » Closed (won't fix)

Version 6 doesn't get updates anymore, so this is a nice solution for the problem.