# Render to PDF

## Content

Set **<span class="code" spellcheck="false" data-prosemirror-content-type="mark" data-prosemirror-mark-name="code">C1PdfDocument</span>** as the rendering target to generate PDF output.
The following example renders the configured chart into a PDF document.

```csharp
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.

>type=note
> **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](/componentone/docs/blazor/online-blazor/controls/flexchartoverview/elements/export-to-image/render-chart-and-diagram/save-rendered-output)