{"id":7853,"date":"2015-10-31T17:32:18","date_gmt":"2015-10-31T17:32:18","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/10\/31\/jspdf-not-working-on-safari-open-source-projects-mrrio-jspdf\/"},"modified":"2015-10-31T17:32:18","modified_gmt":"2015-10-31T17:32:18","slug":"jspdf-not-working-on-safari-open-source-projects-mrrio-jspdf","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/10\/31\/jspdf-not-working-on-safari-open-source-projects-mrrio-jspdf\/","title":{"rendered":"jsPDF not working on Safari-open source projects MrRio\/jsPDF"},"content":{"rendered":"<p>I need to have a button at the end of a HTML page that generates and saves a PDF, so I decided to try jsPDF.<\/p>\n<pre><code>function pdfComprovativo(arg){\n    var doc = new jsPDF();\n    doc.text(20, 20, 'Hello world!');\n    doc.save('Test.pdf');\n}\n<\/code><\/pre>\n<p>I tested this on several browsers and it&#8217;s not working for Safari (5.1.7 version).<\/p>\n<pre><code>doc.output('dataurlnewwindow');\n<\/code><\/pre>\n<p>It works if I replace the save() with this, but I can&#8217;t use this solution because of popup blockers.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I need to have a button at the end of a HTML page that generates and saves a PDF, so I decided to try jsPDF. function pdfComprovativo(arg){ var doc = new jsPDF(); doc.text(20, 20, &#8216;Hello world!&#8217;); doc.save(&#8216;Test.pdf&#8217;); } I tested this on several browsers and it&#8217;s not working for Safari (5.1.7 version). doc.output(&#8216;dataurlnewwindow&#8217;); It works [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7853","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7853","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7853"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7853\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}