title: How to export a Highchart chart to PDF thanks to a button outside the chart?
body: <p>I would like to have a <code>button outside a Highchart chart</code> that <code>export</code> the chart in <code>PDF</code>.</p>
  
  <ul>
  <li>Does it exist a Highchart method to do that ?</li>
  <li>Does an ajax call is mandatory ?</li>
  </ul>
  
  <h2>HTML :</h2>
  
  <pre><code>&lt;script src="http://code.highcharts.com/highcharts.js"&gt;&lt;/script&gt;
  &lt;script src="http://code.highcharts.com/modules/exporting.js"&gt;&lt;/script&gt;
  
  &lt;div id="container" style="height: 400px; margin-top: 1em"&gt;&lt;/div&gt;
  &lt;button id="export2pdf"&gt;Export to PDF&lt;/button&gt;
  </code></pre>
  
  <h2>Javascript :</h2>
  
  <pre><code>$(function () {
      window.chart = new Highcharts.Chart({
          chart: {renderTo : 'container'},
          title: {
              text: 'Exporting module is loaded but buttons are disabled'
          },
          xAxis: {
              categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
          },
  
          series: [{
              data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]        
          }],
          exporting: {
              enabled: true
          }
      });
  
      $("#export2pdf").click(function(){
          // Export method ?
          // Ajax call ?
      });
  });
  </code></pre>
  
  <p>Here is a <a href="http://jsfiddle.net/2M2Je/2/" rel="noreferrer">JsFiddle</a> of what I would like.</p>
  
  <p>Here is a <a href="http://jsfiddle.net/2M2Je/3/" rel="noreferrer">JsFiddle</a> with the solution of <a href="https://stackoverflow.com/users/33727/wergeld">wergeld</a>.</p>