• Resolved arthpix

    (@arthpix)


    The plugin was working great. But suddendly stopped working and now returns a blank page with error:
    Fatal error: Uncaught Mpdf\MpdfException: Data has already been sent to output, unable to output PDF file in /home/vangartc/vangartdecoracion.com/wp-content/plugins/wc-cart-pdf/vendor/mpdf/mpdf/src/Mpdf.php:9547 Stack trace: #0 /home/vangartc/vangartdecoracion.com/wp-content/plugins/wc-cart-pdf/wc-cart-pdf.php(176): Mpdf\Mpdf->Output('WC_Cart-2021072...', 'D') #1 /home/vangartc/vangartdecoracion.com/wp-includes/class-wp-hook.php(292): wc_cart_pdf_process_download('') #2 /home/vangartc/vangartdecoracion.com/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters(NULL, Array) #3 /home/vangartc/vangartdecoracion.com/wp-includes/plugin.php(484): WP_Hook->do_action(Array) #4 /home/vangartc/vangartdecoracion.com/wp-includes/template-loader.php(13): do_action('template_redire...') #5 /home/vangartc/vangartdecoracion.com/wp-blog-header.php(19): require_once('/home/vangartc/...') #6 /home/vangartc/vangartdecoracion.com/index.php(17): require('/home/vangartc/...') #7 {main} thrown in /home/vangartc/vangartdecoracion.com/wp-content/plugins/wc-cart-pdf/vendor/mpdf/mpdf/src/Mpdf.php on line 9547

    Settings:

    • WordPress 5.7.2
    • Woocommerce 5.1.1
    • Woocommerce CartPDF 2.1.3
    • Send copy to admin enabled
    • Using a personalized template to add more data to the pdf
    • Also using a custom function to adds customer ID to filename for logged-in users

    I tried disabling all plugins except for WC itself and WCPDF and also disabling my custom scripts and template, but the same happens. I searched the forum and saw a thread from a year ago with the same issue, but no info in there, nor a posibble solution.

    I don’t now if this error came with the last update. but as far as I remember that was about a week ago.

    Despite the error, this is really a great plugin!!

    Hope someone can help, thanks.

    • This topic was modified 3 years, 7 months ago by arthpix. Reason: Adding some more info

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author David Jensen

    (@dkjensen)

    This is usually indicative of content being printed before the PDF can generate, typically a PHP notice or error. Do you have WP_DEBUG enabled on the site or any notices/errors printing to the screen?

    Thread Starter arthpix

    (@arthpix)

    Thankyou, David.

    Yes I enabled WP_DEBUG and the output was the one i posted in my first message. There aren’t other error notices in the site.

    Plugin Author David Jensen

    (@dkjensen)

    Is the error happening still if you turn WP_DEBUG off and then turn on WP_DEBUG_LOG?

    Thread Starter arthpix

    (@arthpix)

    It was my (ridiculous) mistake…

    Turned on WP_DEBUG_LOG and noticed a different warning about headers already sent in my functions.php line 1.
    Don’t know how, but the first line on the file was blank (Before the php tag) and that affected MPDF, but apparently everything else was working fine. I just erased that line and the plugin got back to work as smooth as before.

    // This line was blank
    <?php
    // My code
    ?>

    Thank you again, for your suggestion about WP_DEBUG-LOG and for this really wonderful plugin.

    • This reply was modified 3 years, 7 months ago by arthpix. Reason: Adding information
    • This reply was modified 3 years, 7 months ago by arthpix.
    Plugin Author David Jensen

    (@dkjensen)

    Ok glad you were able to get it sorted ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Error with MPDF’ is closed to new replies.