简体   繁体   English

将 Microsoft Chart 导出为 PDF 和 JPG 格式

[英]Exporting Microsoft Chart to PDF and JPG formats

In my application, I use Microsoft Chart.在我的应用程序中,我使用 Microsoft Chart。 Below a generated chart, I have two buttons: "Export to PDF", and "Export to JPG".在生成的图表下方,我有两个按钮:“导出为 PDF”和“导出为 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?将图表导出为 PDF 和 JPG 格式的最佳方法是什么? Thanks in advance for any help.提前感谢您的帮助。

jPeg is easy: jPeg 很简单:

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).对于 PDF,您需要获取第三方工具 (ItextSharp?) 或使用 PDF 打印机驱动程序 (dopdf)。 It's not built in.它不是内置的。

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

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