PDF Export Fatal Error

This forum was archived to /woltlab and is now in read-only mode.
  • Hi,

    when i try the export PDF Button i get the following error


    Code
    1. Fatal error: Uncaught exception 'ErrorException' with message 'Illegal string offset 'hex'' in /usr/share/php/dompdf/include/style.cls.php:1418 Stack trace: #0 /usr/share/php/dompdf/include/style.cls.php(1418): Icinga\Application\ApplicationBootstrap->Icinga\Application\{closure}(2, 'Illegal string ...', '/usr/share/php/...', 1418, Array) #1 /usr/share/php/dompdf/include/style.cls.php(682): Style->set_color('inherit') #2 /usr/share/php/dompdf/include/stylesheet.cls.php(1299): Style->__set('color', 'inherit') #3 /usr/share/php/dompdf/include/stylesheet.cls.php(1327): Stylesheet->_parse_properties('color: inherit;...') #4 /usr/share/php/dompdf/include/stylesheet.cls.php(1077): Stylesheet->_parse_sections('button,?input,?...') #5 /usr/share/php/dompdf/include/stylesheet.cls.php(252): Stylesheet->_parse_css('?@font-face {? ...') #6 /usr/share/php/dompdf/include/dompdf.cls.php(605): Stylesheet->load_css('?@font-face {? ...') #7 /usr/share/php/dompdf/include/dompdf.cls.php(696): DOMPDF->_process_html() #8 /usr/share/php/Icinga/ in /usr/share/icingaweb2/library/vendor/Zend/Controller/Plugin/Broker.php on line 332
  • Code
    1. https://icinga2/icingaweb2/monitoring/list/hosts?host_problem=1&sort=host_severity&format=pdf

    Version

    2.4.1

  • Works like a charm for me,

    so it is not an error but something at your machine - library / package etc.


  • If you google the error, it seems to be a dompdf issue. https://github.com/thujohn/pdf-l4/issues/48


    Can you omit the &format=pdf param and post a screenshot? Seems that some character encoding doesn't fit.

  • I had the same issue in Centos7, short investigation showed that a dependency was missing.

    Installation of php-mbstring fixed the issue for me.

  • Small note dompdf exceeds easily the memory limit and execution time of icingaweb2.

    You would have to change
    ini_set('memory_limit',384M');

    ini_set('max_execution_time',300');

    in /usr/share/php/Icinga/File/Pdf.php


    I simply added a 0 (increasing it by factor 10)

  • Created a ticket for the package related issue, please note the github repo for future issue creation.


    https://github.com/Icinga/icinga-packaging/issues/38