Hello @mjunes,
Could you send me the link to the webpage, please?
Best regards.
Thread Starter
mjunes
(@mjunes)
Please find the url in the pastebin.
https://pastebin.com/8tLpbXid
Thank you
Hello @mjunes,
Please, replace the content into the “HTML Content” field in the form with the piece of code below. Concerning to the Chrome for iOS, unfortunately this browser does not support the code window.print
<script>window['printForm']=function(selector){function _cloneCanvas(newCanvas,oldCanvas){var context=newCanvas.getContext('2d');newCanvas.width=oldCanvas.width;newCanvas.height=oldCanvas.height;context.drawImage(oldCanvas,0,0);};function _getStyles(){var r='';$(document).find('link[type*="css"],style').each(function(){r+=this.outerHTML;});return r;};function _callPrint(w){if(w&&w["printMe"]) w["printMe"]();else setTimeout(function(){_callPrint(w);},50);};try{if(typeof jQuery!='undefined'){if(typeof selector!='undefined'){var $=jQuery,f=$(selector),c,e,h,t,w,d;if(f.length){c=f.clone();c.find('script').remove();c.find('input').each(function(){e=$(this);if(typeof e.prop('checked')!='undefined') e.attr('CHECKED',e.prop('checked'));e.attr('value',e.val());});h=c[0].outerHTML;c.find('TEXTAREA').each(function(){e=$(this);t=e.parent().html();h=h.replace(t,e.val());});c.find('SELECT').each(function(){e=$(this);t=e.parent().html();h=h.replace(t,f.find('#'+e.attr('id')+' option:selected').text());});w=$('#cff_iframe_for_printing');if(w.length==0) {w=$('<iframe id="cff_iframe_for_printing" name="cff_iframe_for_printing" style="display:none;"></iframe>');w.appendTo('body');} d=w[0].contentWindow.document;d.write('<body>'+_getStyles()+h+'</body>');setTimeout(function(){d.close();$(d).find('canvas').each(function(i,e){_cloneCanvas(e,f.find('canvas:eq('+i+')')[0]);});var ua=window.navigator.userAgent,msie=ua.indexOf("MSIE ");if(msie!==0){w[0].contentWindow.document.execCommand('print',false,null);}else{w[0].contentWindow.print();}},1500);}else{throw"Form's selector is incorrect";}}else{throw'Requires the selector';}}else{throw'Requires the jQuery framework';}}catch(err){if(typeof console!='undefined') console.log(err);}};</script>
Best regards.
Thread Starter
mjunes
(@mjunes)
Hello Codepeople,
Thank you very much. It works in iOS Safari now.
Hello @mjunes,
Thank you very much for letting me know.
Best regards.