开发者

Exporting Microsoft Chart to PDF and JPG formats

开发者 https://www.devze.com 2023-03-11 22:16 出处:网络
In my application, I use Microsoft Chart. Below a generated chart, I开发者_如何学Python have two buttons: \"Export to PDF\", and \"Export to JPG\". However, I\'m not sure of how to go about implementi

In my application, I use Microsoft Chart. Below a generated chart, I开发者_如何学Python have two buttons: "Export to PDF", and "Export to JPG". However, I'm not sure of how to go about implementing these two buttons.

What would be the best way to export the chart to PDF and JPG formats? Thanks in advance for any help.


jPeg is easy:

Chart1.SaveImage(@"C:\MyImage.jpg", System.Web.UI.DataVisualization.Charting.ChartImageFormat.Jpeg);

For PDF, you'll need to get a third party tool (ItextSharp?) or use a PDF printer driver (dopdf). It's not built in.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号