Constant error in the DOMPDF library

3

I installed the dompdf package on laravel4, using the composer. However, you are giving the following error when trying to create the object:

  

Use of undefined constant DOMPDF_TEMP_DIR - assumed 'DOMPDF_TEMP_DIR'

The php being used is 5.3.10, laravel 4.0.10

creative code:

$pdf = new DOMPDF();

dompdf definitions file code:

def("DOMPDF_TEMP_DIR", sys_get_temp_dir());

Even if this setting or inclusion is changed by include , the error persists.

Does anyone know the reason for the error or have you experienced this?

    
asked by anonymous 06.01.2014 / 18:47

1 answer

1

From what I read in the documentation, you must make the DOMPDF configuration file require before instantiating the object.

require_once '/path/to/vendor/dompdf/dompdf/dompdf_config.inc.php';

I recommend putting it in /app/start/global.php

Source: link

    
06.01.2014 / 19:48