/// <summary> /// The write plot. /// </summary> /// <param name="plot">The plot.</param> public void WritePlot(PlotFigure plot) { if (this.FileName == null) { return; } var directory = Path.GetDirectoryName(this.FileName); if (directory == null) { return; } var source = string.Format( "{0}_Plot{1}.png", Path.GetFileNameWithoutExtension(this.FileName), plot.FigureNumber); var sourceFullPath = Path.Combine(directory, source); // write to a png // todo: write to a stream, not to disk PngExporter.Export(plot.PlotModel, sourceFullPath, (int)plot.Width, (int)plot.Height, OxyColors.Automatic); // append the image to the document this.AppendImage(sourceFullPath, "Plot" + plot.FigureNumber); this.body.AppendChild(CreateParagraph(plot.GetFullCaption(this.style), FigureTextId)); }
/// <summary> /// The write plot. /// </summary> /// <param name="plot"> /// The plot. /// </param> public void WritePlot(PlotFigure plot) { if (this.FileName == null) { return; } var directory = Path.GetDirectoryName(this.FileName); if (directory == null) { return; } var source = string.Format( "{0}_Plot{1}.pdf", Path.GetFileNameWithoutExtension(this.FileName), plot.FigureNumber); var sourceFullPath = Path.Combine(directory, source); PdfExporter.Export(plot.PlotModel, sourceFullPath, plot.Width, plot.Height); var p = this.WriteStartFigure(plot); MigraDoc.DocumentObjectModel.Shapes.Image pi = p.AddImage(sourceFullPath); pi.Width = Unit.FromCentimeter(15); this.WriteEndFigure(plot, p); }
/// <summary> /// Writes the specified plot. /// </summary> /// <param name="plot">The plot.</param> void IReportWriter.WritePlot(PlotFigure plot) { var temporaryPlotFileName = Guid.NewGuid() + ".pdf"; this.temporaryPlotFiles.Add(temporaryPlotFileName); PdfExporter.Export(plot.PlotModel, temporaryPlotFileName, plot.Width, plot.Height); var p = this.WriteStartFigure(plot); MigraDoc.DocumentObjectModel.Shapes.Image pi = p.AddImage(temporaryPlotFileName); pi.Width = Unit.FromCentimeter(15); this.WriteEndFigure(plot, p); }
/// <summary> /// The write plot. /// </summary> /// <param name="plot"> /// The plot. /// </param> public void WritePlot(PlotFigure plot) { }
/// <summary> /// Writes the plot. /// </summary> /// <param name="plot">The plot.</param> public void WritePlot(PlotFigure plot) { // string path = "plot" + plotNumber + ".pdf"; // PdfExporter.Export(Model, pdfPlotFileName, 800, 500); }