最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Export Multiple Highcharts to Multi-page PDF - Stack Overflow

programmeradmin2浏览0评论

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?

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?

Share Improve this question asked Sep 16, 2015 at 17:10 dbarton_ukdbarton_uk 1,06712 silver badges18 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 6

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

See http://jsfiddle/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>

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

发布评论

评论列表(0)

  1. 暂无评论