You are here

function _invoice_dompdf_include_lib in Invoice 6

Same name and namespace in other branches
  1. 7 invoice_helpers.inc \_invoice_dompdf_include_lib()

Helper function to include the dompdf library

1 call to _invoice_dompdf_include_lib()
invoice_view_pdf in ./invoice.module
Display the invoice in PDF format

File

./invoice_helpers.inc, line 590
Invoice module

Code

function _invoice_dompdf_include_lib() {
  $drupalRootDirectory = dirname($_SERVER['SCRIPT_FILENAME']);
  if (file_exists($drupalRootDirectory . '/sites/all/libraries/dompdf/dompdf_config.inc.php')) {
    require_once $drupalRootDirectory . '/sites/all/libraries/dompdf/dompdf_config.inc.php';
  }
  else {
    if (file_exists(dirname(__FILE__) . '/../../libraries/dompdf/dompdf_config.inc.php')) {
      require_once dirname(__FILE__) . '/../../libraries/dompdf/dompdf_config.inc.php';
    }
    else {
      if (file_exists(dirname(__FILE__) . '/dompdf/dompdf_config.inc.php')) {

        // Backward compatible
        require_once dirname(__FILE__) . '/dompdf/dompdf_config.inc.php';
      }
      else {
        throw new Exception(t('The DOMPDF library could not be found!'));
      }
    }
  }
}