Skip to content

Commit cb5c640

Browse files
authored
Merge pull request #516 from telerik/new-kb-add-charts-to-pdf-radpdfprocessing-cc7f20b697f94c579e24fb4b933bf5ff
Added new kb article add-charts-to-pdf-radpdfprocessing
2 parents 17584df + bc48d89 commit cb5c640

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: Adding Charts to a PDF Document in RadPdfProcessing
3+
description: Learn how to insert charts into a PDF document using RadPdfProcessing.
4+
type: how-to
5+
page_title: How to Include Charts in PDF Files with RadPdfProcessing
6+
slug: add-charts-to-pdf-radpdfprocessing
7+
tags: pdfprocessing, document, processing, chart, pdf, image, export
8+
res_type: kb
9+
ticketid: 1679135
10+
---
11+
12+
## Environment
13+
14+
| Version | Product | Author |
15+
| ---- | ---- | ---- |
16+
| 2025.1.205 (2025 Q1)| RadPdfProcessing |[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)|
17+
18+
## Description
19+
20+
This article shows how to programmatically generate a Chart and embed it into a PDF file using [RadPdfProcessing]({%slug radpdfprocessing-overview%}).
21+
22+
## Solution
23+
24+
RadPdfProcessing doesn't provide functionality for generating chart elements inside the PDF document. However, the chart can be generated by the appropriate UI control and export it as an image which can be later inserted in the document.
25+
26+
To embed a chart into a PDF document using RadPdfProcessing, follow these steps:
27+
28+
1\. **Export the Chart as an Image**: First, generate the chart you want to include in your PDF with the appropriate UI control offered by the Telerik family and convert it an image format.
29+
30+
- For **.NET Standard** scenario, it is suitable to use the Telerik UI for Blazor Chart, and utilize the [Export Chart as Image](https://www.telerik.com/blazor-ui/documentation/knowledge-base/chart-export-to-image) feature. Refer to [forum post](https://www.telerik.com/forums/export-chart-as-image-47277c4c2e77) for detailed instructions.
31+
32+
- For **.NET Framework** scenario, it is suitable to use the Telerik UI for WinForms ChartView, and utilize its [Export to image]({%slug winforms/chartview-/features/export%}) functionality.
33+
34+
2\. **Insert the Image into the PDF**: After obtaining the image of your chart, use RadPdfProcessing to insert this image into your PDF document. RadPdfProcessing offers two approaches for working with images in PDFs:
35+
36+
- Using `FixedContentEditor` as detailed in [How to Generate a PDF Document from Images with FixedContentEditor]({%slug pdf-from-images-with-fixedcontenteditor%}).
37+
38+
- Utilizing `RadFixedDocumentEditor` as outlined in [How to Generate a PDF Document from Images with RadFixedDocumentEditor]({%slug pdf-from-images-with-radfixeddocumenteditor%}).
39+
40+
Choose the approach that best suits your needs. Both methods will allow you to insert and scale the image (chart) as needed within your PDF document.
41+
42+
## See Also
43+
44+
- [Exporting Telerik UI for Blazor Chart as Image](https://www.telerik.com/blazor-ui/documentation/knowledge-base/chart-export-to-image)
45+
- [Telerik UI for Blazor Chart Documentation](https://docs.telerik.com/blazor-ui/components/chart/overview)
46+
- [How to Draw a Chart with FixedContentEditor in PdfProcessing]({%slug draw-chart-with-fixedcontenteditor%})

0 commit comments

Comments
 (0)