[]
        
(Showing Draft Content)

Render to PDF

Set C1PdfDocument as the rendering target to generate PDF output.

The following example renders the configured chart into a PDF document.

using C1.Chart;
using C1.Pdf;

// chart is an existing configured FlexChart or FlexDiagram.

using (var doc = new C1PdfDocument())
{
    float margin = 72;
    float width = doc.PageSize.Width - 2 * margin;
    float height = (doc.PageSize.Height - 2.5f * margin) / 2;

    chart.Render(doc, margin, margin, width, height);

    doc.Save("Chart.pdf");
}

The rendering rectangle determines the position and dimensions of the chart on the PDF page.

Note: The example saves the PDF to a file-system location. Applications that do not support direct file-system access require a stream-based or platform-specific saving workflow.

See Also

Save Rendered Output