• Hi,
    I have a problem with the generation of images: locally, it works well but in production I have red crosses instead of images (both on the one I manage from the page and for the logo used in the header)
    I can’t find how to debug, especially where to put
    $mpdf->showImageErrors = true;
    because I don’t have an include directory in V2.2.0 of the WordPress plugin

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author dinamiko

    (@dinamiko)

    Hello @yovovy,

    I have planed to make it easier to debug such issues via UI in the future, but for now you have to still add $mpdf->showImageErrors = true; line manually, in latest version 2.2.0 you can add the line inside the configureMpdfSettings function in modules/PDF/DocumentBuilder.php, you can temporarily add the line at the top of the function like so:

    private function configureMpdfSettings( Mpdf $mpdf ): void {
    $mpdf->showImageErrors = true;
    ...

    Try it and let me know what the error is about, also ensure that your server has at least the mbstring and gd php extensions loaded.

    Thread Starter Olivier GA

    (@yovovy)

    thank for the quick reply!
    when i put $mpdf->showImageErrors = true; it’s return me an error “Unable to generate PDF. Please try again later.” ,(

    GD and mbstring are loaded, same as localhost except Configure Command : enable-mbstring=shared instead of all in localhost … And i don’t know what it means ,)

    Plugin Author dinamiko

    (@dinamiko)

    @yovovy Try adding the following to see if the error message provides the concrete error:

    $mpdf->debug = true;

    Also try adding the following to see if error is related to cURL:

    $mpdf->curlAllowUnsafeSslRequests = true;

    If none of the above works, feel free to contact me at hi@dinamiko.dev so I could take a deeper look.

    Thread Starter Olivier GA

    (@yovovy)

    I already try

    $mpdf->debug = true;

    cause i see the ConfigVariables.php but still the same error
    i will check if the error is still here when i go to production (not the same server … i know it’s bad ,) i’ll came back to
    thank for all

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.