<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
      <title>jspdf on Roy Tang</title>
      <link>https://mirror.roytang.net/tags/jspdf/</link>
      <description>Recent content in jspdf on Roy Tang</description>
      <generator>Hugo -- gohugo.io</generator>
      <language>en-us</language>
      <managingEditor>hello@roytang.net (Roy Tang)</managingEditor>
      <webMaster>hello@roytang.net (Roy Tang)</webMaster>
      <lastBuildDate>Sun, 17 Sep 2017 12:22:12 +0000</lastBuildDate>
      
          <atom:link href="https://mirror.roytang.net/tags/jspdf/index.xml" rel="self" type="application/rss+xml" />
      
          
      
        <item>
            <title>New note
</title>
            <link>https://mirror.roytang.net/2017/09/46264021/</link>
            <pubDate>Sun, 17 Sep 2017 12:22:12 +0000</pubDate>
            <author>hello@roytang.net (Roy Tang)</author>
            <guid>https://mirror.roytang.net/2017/09/46264021/</guid>
            <description>
            

            &lt;p&gt;I have an HTML page with around 10 charts generated by chart.js (so these are canvas elements). I want to be able to export the page content into a PDF file.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve tried using jsPDF&amp;rsquo;s .fromHTML function, but it doesn&amp;rsquo;t seem to support exporting the canvas contents. (Either that or I&amp;rsquo;m doing it wrong). I just did something like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    $(&amp;quot;.test&amp;quot;).click(function() {
  var doc = new jsPDF()

  doc.fromHTML(document.getElementById(&amp;quot;testExport&amp;quot;));
  doc.save(&#39;a4.pdf&#39;)
});
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Any alternative approaches would be appreciated.&lt;/p&gt;



            </description>
        </item>
    
    </channel>
  </rss>