PHP-font-lib must either be installed via composer or copied to lib/php-font-lib

前端 未结 3 1277
無奈伤痛
無奈伤痛 2020-12-05 10:03

i\'m trying to convert some html to pdf. After some google search i find dompdf but when i try to convert i retrieve

PHP-font-lib must either be installed          


        
3条回答
  •  余生分开走
    2020-12-05 10:38

    Another trick, to avoid the change of automated downloaded files from Composer, is define the DOMPDF_ENABLE_AUTOLOAD and after reload the config file:

    // Disable DOMPDF's internal autoloader if you are using Composer
    define('DOMPDF_ENABLE_AUTOLOAD', false);
    require_once CONFIG_DIR . 'vendor/dompdf/dompdf/dompdf_config.inc.php';
    
    $dompdf = new \DOMPDF;
    

提交回复
热议问题