The PlotModel has the ToSvg method. I was searching for the pdf export functionality and had to use one of the examples to find out how to do this.
I think it would be great if a small extension method could be added:
```
public static byte[] ToPdf(this PlotModel plotModel)
{
Argument.IsNotNull(() => plotModel);
return ToPdf(plotModel, plotModel.Width, plotModel.Height);
}
public static byte[] ToPdf(this PlotModel plotModel, double width, double height)
{
Argument.IsNotNull(() => plotModel);
using (var memoryStream = new MemoryStream())
{
PdfExporter.Export(plotModel, memoryStream, width, height);
return memoryStream.ToArray();
}
}
```
Comments: Decided to remove ToSvg instead! I think it is better to reduce the number of ways to export to Svg/Pdf. Export is documented at http://oxyplot.org/doc/ExportPdf.html and http://oxyplot.org/doc/ExportSvg.html
I think it would be great if a small extension method could be added:
```
public static byte[] ToPdf(this PlotModel plotModel)
{
Argument.IsNotNull(() => plotModel);
return ToPdf(plotModel, plotModel.Width, plotModel.Height);
}
public static byte[] ToPdf(this PlotModel plotModel, double width, double height)
{
Argument.IsNotNull(() => plotModel);
using (var memoryStream = new MemoryStream())
{
PdfExporter.Export(plotModel, memoryStream, width, height);
return memoryStream.ToArray();
}
}
```
Comments: Decided to remove ToSvg instead! I think it is better to reduce the number of ways to export to Svg/Pdf. Export is documented at http://oxyplot.org/doc/ExportPdf.html and http://oxyplot.org/doc/ExportSvg.html