• Resolved riaface

    (@riaface)


    Hi,

    I’m getting the following error when I try and download the PDF via the Woocommerce orders list:

    Fatal error: Class 'Imagick' not found
    #0 /home/sundrago/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/lib/Cpdf.php(4984): Cpdf->addImagePngAlpha('/home/sundrago/...', 57.442913385827, 727.75417322835, 69.012719563901, 85.03937007874, 6)
    #1 /home/sundrago/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/Adapter/CPDF.php(864): Cpdf->addPngFromFile('/home/sundrago/...', 57.442913385827, 727.75417322835, 69.012719563901, 85.03937007874)
    #2 /home/sundrago/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/Renderer/Image.php(110): Dompdf\Adapter\CPDF->image('/home/sundrago/...', 57.442913385827, 29.096456692913, 69.012719563901, 85.03937007874, 'normal')
    #3 /home/sundrago/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/Renderer.php(293): Dompdf\Renderer\Image->render(Object(Dompdf\FrameDecorator\Image))
    #4 /home/sundrago/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/Renderer.php(127): Dompdf\Renderer->_render_frame('image', Object(Dompdf\FrameDecorator\Image))
    #5 /home/sundrago/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/Renderer.php(194): Dompdf\Renderer->render(Object(Dompdf\FrameDecorator\Image))
    #6 /home/sundrago/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/Renderer.php(194): Dompdf\Renderer->render(Object(Dompdf\FrameDecorator\TableCell))
    #7 /home/sundrago/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/Renderer.php(194): Dompdf\Renderer->render(Object(Dompdf\FrameDecorator\TableRow))
    #8 /home/sundrago/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/Renderer.php(194): Dompdf\Renderer->render(Object(Dompdf\FrameDecorator\TableRowGroup))
    #9 /home/sundrago/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/Renderer.php(194): Dompdf\Renderer->render(Object(Dompdf\FrameDecorator\Table))
    #10 /home/sundrago/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/FrameReflower/Page.php(148): Dompdf\Renderer->render(Object(Dompdf\FrameDecorator\Block))
    #11 /home/sundrago/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/FrameDecorator/AbstractFrameDecorator.php(895): Dompdf\FrameReflower\Page->reflow(NULL)
    #12 /home/sundrago/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/Dompdf.php(847): Dompdf\FrameDecorator\AbstractFrameDecorator->reflow()
    #13 /home/sundrago/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/class-wcpdf-pdf-maker.php(53): Dompdf\Dompdf->render()
    #14 /home/sundrago/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(585): WPO\WC\PDF_Invoices\PDF_Maker->output()
    #15 /home/sundrago/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(620): WPO\WC\PDF_Invoices\Documents\Order_Document->get_pdf()
    #16 /home/sundrago/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/class-wcpdf-main.php(255): WPO\WC\PDF_Invoices\Documents\Order_Document->output_pdf('inline')
    #17 /home/sundrago/public_html/wp-includes/class-wp-hook.php(286): WPO\WC\PDF_Invoices\Main->generate_pdf_ajax('')
    #18 /home/sundrago/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array)
    #19 /home/sundrago/public_html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
    #20 /home/sundrago/public_html/wp-admin/admin-ajax.php(167): do_action('wp_ajax_generat...')
    #21 {main}

    This has only just started to happen. Are you able to let me know how to resolve this please?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! If this started happening recently, it probably means that your server was updated and some libraries are missing. I recommend reaching out to your host and ask if they can install/activate the Imagick PHP extension.
    If you currently use a PNG image for the header logo, you could try switching to JPG, which may also resolve the issue (not 100% sure though). You will also need to enable “always use most current settings” in the Documents > Invoice settings so that the jpg logo will also be used for existing invoices.

    Let us know if that helps or if you need more information!

    Thread Starter riaface

    (@riaface)

    Imagick was enabled, so it wasn’t that, but changing the image to JPG seems to have done the job. Thanks!

    Plugin Contributor Ewout

    (@pomegranate)

    yes, if imagemagick wasn’t enabled, it would not have tried to call the class at all, but it seems there’s something wrong with the installation if the class itself cannot be found. Glad to hear the JPG solution works for you too, though I would still recommend reaching out to your host to prevent any future issues with this!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error when trying to download PDFs’ is closed to new replies.