Export Multiple Highcharts to Multi-page PDF

2019-02-16 03:50发布

I am trying to export multiple charts to a pdf file, with each of the charts to be displayed on a different pdf page.

Code here: JSFiddle

You can see multiple chart are exported, but they are all placed on a single pdf page. Does anyone know of a way to separate, so that each chart is placed on to its own page?

2条回答
beautiful°
2楼-- · 2019-02-16 04:18

In the Highcharts you can setup your own exporitng server and export multiple charts to single PDF. See manual for that here

Using phantomJS you can break SVG to pages, like in related topic: How to handle PDF pagination in PhantomJS

查看更多
forever°为你锁心
3楼-- · 2019-02-16 04:21

Not sure how to do what you want with the Highcharts PDF server, you can do this with the http://www.cloudformatter.com/css2pdf server by formatting a div containing the charts and surrounding charts with a div setting the page-break.

See http://jsfiddle.net/zvx6eb7e/23/

<div id="JSFiddle">
    <!-- Insert your document here -->
    <header style="display:none;margin-top:20px;"><p>Add your header</p></header>     
    <footer style="display:none"><p>Add your header</p></footer>  
    <div id="container1" style="height: 200px; width:700px"></div>
    <div style="page-break-before:always;">
      <div id="container2" style="height: 200px;  width:700px"></div>
  </div>
</div>
查看更多
登录 后发表回答