Hi,
I would like to download a dynamically generated PDF like in the example below. Anyway the return type is bool thus this dowsn't produce any effect. Some suggestion?
// Row Custom Action event
public bool Row_CustomAction(string action, Dictionary<string, object> row) {
if (action == "star") { // Check action name
Syncfusion.Pdf.PdfDocument doc = new Syncfusion.Pdf.PdfDocument();
//Add a page.
Syncfusion.Pdf.PdfPage page = doc.Pages.Add();
Syncfusion.Pdf.Graphics.PdfGraphics graphics = page.Graphics;
Syncfusion.Pdf.Graphics.PdfFont font = new Syncfusion.Pdf.Graphics.PdfStandardFont(Syncfusion.Pdf.Graphics.PdfFontFamily.Helvetica, 20);
graphics.DrawString("Hello World!!!", font, Syncfusion.Pdf.Graphics.PdfBrushes.Black, new PointF(0, 0));
MemoryStream stream = new MemoryStream();
doc.Save(stream);
stream.Position = 0;
//Download the PDF document in the browser.
FileStreamResult fileStreamResult = new FileStreamResult(stream, "application/pdf");
fileStreamResult.FileDownloadName = "Sample.pdf";
return true;
}
return true;
}