Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

omontes's avatar

Error when generating pdf using dompdf library

Hello friends I'm generating a pdf for which I use the following library https://github.com/thujohn/pdf-l4

I'm getting this error

iconv (): Wrong charset, conversion from `auto 'to' utf-8 // IGNORE 'is not allowed

this is my code

Route::get('generate', function()
{
    $html = '<html><body>'
            . '<p>Put your html here, or generate it with your favourite '
            . 'templating system.</p>'
            . '</body></html>';
    return PDF::load($html, 'A4', 'portrait')->show();
});
0 likes
0 replies

Please or to participate in this conversation.