skip to Main Content

platform: wordpress + woocommerce + PDF Product Vouchers

When generating a voucher, an error sometimes pops up:
could not generate voucher pdf: cannot create voucher: incorrect magic number (0)

What could be the problem?

3

Answers


  1. Chosen as BEST ANSWER

    The problem was caused by the plugin: mail log. After disabling, everything works without errors. Probably the problem is in the incorrect function of sending letters.


  2. If you mean Skyverge product, it’s actual issue. Skyverge is looking for a solution. But if ASAP, then try to replace with PDF plugin version 3.8, not 3.9 and newer.

    Login or Signup to reply.
  3. You’re getting this error because your hosting server has an incorrect SSL certificate set for OpenSSL, so when this third-party library dompdf (which is being used by SkyVerge) sends a file_get_contents() request to this URL to load Google fonts, it throws this error SSL: Connection reset by peer.

    The quick solution to fix it is to put this snippet below in your functions.php or any code snippet plugin like WPCode, which will unload Google Fonts and use the default fonts:

    add_filter('wc_pdf_product_vouchers_available_google_fonts', function(){
        return [];
    });
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search