//Create a new PDF document
PdfDocument document = new PdfDocument();
//Add a page
PdfPage page = document.Pages.Add();
//Create font
FileStream fontFileStream = new FileStream("fontawesome-webfont.ttf", FileMode.Open, FileAccess.Read);
PdfFont font = new PdfTrueTypeFont(fontFileStream, 14);
//Create a PdfGrid
PdfGrid pdfGrid = new PdfGrid();
//Create a DataTable
DataTable dataTable = new DataTable();
//Add columns to the DataTable
dataTable.Columns.Add("Font Name");
dataTable.Columns.Add("Awesome Character");
//Add rows to the DataTable
dataTable.Rows.Add(new object[] { "fontawesome-webfont", "\uf02d" });
//Assign data source
pdfGrid.DataSource = dataTable;
//Add cell style
PdfGridCellStyle cellStyle = new PdfGridCellStyle();
cellStyle.Font = font;
pdfGrid.Rows[0].Cells[1].Style = cellStyle;
//Draw grid to the page of PDF document
pdfGrid.Draw(page, new PointF(10, 10));
//Save the document
MemoryStream stream = new MemoryStream();
document.Save(stream);
document.Close(true); |
Hello Sowmiya,
i also want to export a Grid with columns contains several FontAwesome icons. How can i achieve to export these icons with pdf export of Grid?
Regards
Stefan
Hi Martin,
Currently, The EJ2 Grid does not have support to export icons and custom
elements. You can export images and hyperlinks from the Grid. Please find the
below demo for your reference.
Demo: https://ej2.syncfusion.com/aspnetcore/Grid/DefaultExporting#/fluent
We logged a feature task for your requirement as “Need to provide support for exporting grid with column template and Detail template” and added it to our feature request database. At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technical feasibility, and customer interest. This feature will be included in any of our upcoming releases.
Feedback Link: https://www.syncfusion.com/feedback/10384/need-to-provide-support-for-exporting-grid-with-column-template-and-detail
You can communicate with us regarding the open features any time using the
above Feature Report page.
Regards,
Rajapandiyan S
Hi Martin,
We are glad to announce that our Essential Studio 2023 Volume 3 Release v23.1.36 is rolled out and is available for download under the following link.
In this release, we have included the feature for “Need to provide support for exporting grid with column template and Detail template”. So please upgrade your Syncfusion package to the latest version to resolve your reported issue.
Release Notes: https://ej2.syncfusion.com/angular/documentation/release-notes/23.1.36?type=all#grid
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.
Regards,
Dineshnarasimman