简体   繁体   English

将多个图表导出到多页PDF

[英]Export Multiple Highcharts to Multi-page PDF

I am trying to export multiple charts to a pdf file, with each of the charts to be displayed on a different pdf page. 我正在尝试将多个图表导出到pdf文件,每个图表将显示在不同的pdf页面上。

Code here: JSFiddle Code here: JSFiddle

You can see multiple chart are exported, but they are all placed on a single pdf page. 您可以看到已导出多个图表,但是它们都放在一个pdf页面上。 Does anyone know of a way to separate, so that each chart is placed on to its own page? 有谁知道分离的方法,以便将每个图表放在自己的页面上?

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. 不确定如何使用Highcharts PDF服务器执行所需操作时,可以使用http://www.cloudformatter.com/css2pdf服务器执行此操作,方法是格式化包含图表的div和周围的图表,并使用div设置分页符。

See http://jsfiddle.net/zvx6eb7e/23/ 参见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>

In the Highcharts you can setup your own exporitng server and export multiple charts to single PDF. 在Highcharts中,您可以设置自己的exporitng服务器,并将多个图表导出为单个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 使用phantomJS,您可以将SVG拆分为页面,如相关主题: 如何在PhantomJS中处理PDF分页一样

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM