{"id":219,"date":"2017-09-04T14:58:00","date_gmt":"2017-09-04T14:58:00","guid":{"rendered":"https:\/\/demos.welaunch.io\/woocommerce-pdf-catalog\/?post_type=faq&p=219"},"modified":"2020-07-29T14:33:25","modified_gmt":"2020-07-29T12:33:25","slug":"images-pdf-displays-red-cross-https-mpdf","status":"publish","type":"faq","link":"https:\/\/www.welaunch.io\/en\/knowledge-base\/faq\/images-pdf-displays-red-cross-https-mpdf\/","title":{"rendered":"Images in PDF displays as a red cross (https \/ mpdf)"},"content":{"rendered":"
First\u00a0 please make sure, that you are not on a localhost<\/strong> AND do not have any .htaccess \/ .passwd<\/strong> on your sever. Because our plugin uses HTTP to get the images for the PDF creation and if your server blocks the images from public it won’t work.<\/p>\n Problem not solves? Read further:<\/p>\n Please make sure you have installed \/ configured the following in your Server PHP Extensions:<\/p>\n To debug image loading go to plugin settings > advanced settings. There enable the MPDF Debug mode:<\/p>\n Look what the image errors show. Maybe you find the issue yourself.<\/p>\n If images still do not display you can solve the issue by the following ways:<\/p>\n Quick and Dirty:<\/strong><\/p>\n Add the following to the mpdf.php file on line 12954 -> function:\u00a0file_get_contents_by_curl()<\/p>\n Source:\u00a0https:\/\/stackoverflow.com\/questions\/5657382\/curl-php-restful-service-always-returning-false<\/p>\n Better:<\/strong><\/p>\n The better solution is to manually add only the certificate(s) or CA(s) you want to accept<\/p>\n Source:\u00a0https:\/\/stackoverflow.com\/questions\/24611640\/curl-60-ssl-certificate-unable-to-get-local-issuer-certificate<\/p>\n On Nginx?<\/strong><\/p>\n Some nginx server disallow some agents in the CURL header. Therefore you will need to change the header. Go to plugin-folder\/includes\/mpdf\/mpdf.php > Line: 12965.<\/p>\n Then change the\u00a0CURLOPT_USERAGENT value to\u00a0‘User-Agent: curl\/7.39.0’<\/p>\n Example:<\/p>\n\n

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);<\/pre>\n
;;;;;;;;;;;;;;;;;;;;\r\n; php.ini Options ;\r\n;;;;;;;;;;;;;;;;;;;;\r\n\r\ncurl.cainfo = \"C:\\xampp\\php\\extras\\ssl\\cacert.pem\"\r\n<\/pre>\n
curl_setopt($ch, CURLOPT_USERAGENT, 'User-Agent: curl\/7.39.0');<\/pre>\n","protected":false},"author":1,"featured_media":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","product_cat":[],"class_list":["post-219","faq","type-faq","status-publish","hentry","faq_topics-pdf-catalog-faq"],"_links":{"self":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq"}],"about":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/types\/faq"}],"author":[{"embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/comments?post=219"}],"version-history":[{"count":1,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/219\/revisions"}],"predecessor-version":[{"id":5508,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/219\/revisions\/5508"}],"wp:attachment":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/media?parent=219"}],"wp:term":[{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/product_cat?post=219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}