• Resolved jj34ls

    (@jj34ls)


    Hello,

    Today I have a problem with the generation of invoices, for an unknown reason it seems that the extension cannot read the image of my logo. How to solve this problem?

    Error sentence : “Error when trying to generate the document?: unable to open image”

    For your information, I have not added any new extensions or what, so I think this error comes from the last update of the extension, if someone encounters the same problem could you tell me how to solve it..

    Have a good day everyone

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @jj34ls,

    Is it possible that your shop logo is in PGN format? If so, could you please try to convert it into a JPEG/JPG file and try again?

    Please note that our PDF engine (dompdf) needs GMagick or IMagick installed on your server to render the PNG images. Also, we are aware of some hosting providers that have custom builds of these extensions which generates issues sometimes, so using a JPEG image for your shop logo is always safer, that is why we always recommended using a JPEG image when possible.

    Thread Starter jj34ls

    (@jj34ls)

    Hello, thank you for your quick return,

    The complete error is as follows: Exception: unable to open image ‘file:///home/(user)/public_html/wp-content/uploads/2023/12/2-1.png’: No such file or directory @ error/blob.c/OpenBlob/3569

    Le fichier initial fonctionne très bien, vous pouvez le voir avec ce lien : https://www.libertesensuelle.com/wp-content/uploads/2023/12/2-1.png

    The error occurs in the Imagick library, precisely in the function?readImage(). This function is called by?addImagePngAlpha()?in?Cpdf.php, which is part of the DOMPDF library used by the WooCommerce PDF Invoices & Packing Slips plugin.

    Thread Starter jj34ls

    (@jj34ls)

    I converted the file to JPG and indeed everything works again, thank you for your help!

    Have a pleasant day!

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Thanks for providing more details, @jj34ls: This confirms that you are using a PNG file for your shop logo. So it is likely that your hosting provider has a custom build, as I mentioned previously.

    Did you try switching your shop logo with a JPEG version instead? The JPEG images are compatible with 99.99% of servers, so you should not have any issues with this image format.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    I converted the file to JPG and indeed everything works again, thank you for your help!

    Thanks for confirming that it worked, @jj34ls!

    Have a nice day, you too! ??

    Dear @yordansoares I’m having the exact same problem. Replaced the image with a .jpg , I can see the preview just fine after that, but when trying to generate a pdf invoice from an order in Woocommerce, the error reappears, the plugin is looking for the PNG file.
    I tried reinstalling the fonts, in the hope that would flush any caching in the plugin, that did not help. Reinstalled a fresh copy of the plugin, that did not help either.
    I hope you can advise what to do next?

    Plugin Contributor Mohamad

    (@mohamadntr)

    @erwin1974 Did you try to remove the current document and generate it again?

    If the issue persists, could you check the “Test mode” setting under the General tab and try generating the document again?

    @mohamadntr That did the trick. Your help is very much appreciated!

    Plugin Contributor Mohamad

    (@mohamadntr)

    @erwin1974 I’m glad I could help.

    All the best!

    Plugin Contributor kluver

    (@kluver)

    @erwin1974 As a follow-up: Make sure that test mode is disabled after creating the invoice, as it will generate each document with the latest settings. Which is not something you want to have enabled on a live site, as the invoice should be immutable after issuing.

    You can also choose the regenerate the invoice on a per order basis by clicking on the ‘Regenerate’ icon in the ‘PDF Document Data’ meta box on the order edit page. More information can be found here: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/show-pdf-documents-with-the-latest-settings/

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘No such file or directory’ is closed to new replies.