Exporting Microsoft Chart to PDF and JPG formats
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.
精彩评论