Failed to load PDF document.

i'm using mvc to export PDF Document by specific structure and by using the "ExportAsActionResult" 
the document is saved but "Corrupted " 
with "Failed to load PDF document"  message

using Syncfusion.Pdf;
using Syncfusion.Mvc.Pdf;
using Syncfusion.Pdf.Tables;
using Syncfusion.Pdf.Graphics;
        public ActionResult ExportPDF()
        {
DataTable dataTable = GetDataTable();
            PdfDocument doc = new PdfDocument();
PdfPage page = doc.Pages.Add();
PdfLightTable table = new PdfLightTable();
            table.DataSource = dataTable;
            table.Draw(page, new PointF(20, 15));
            return doc.ExportAsActionResult('x.pdf', HttpContext.ApplicationInstance.Response, HttpReadType.Save);
        }

1 Reply

KC Karthikeyan Chandrasekar Syncfusion Team August 1, 2018 11:23 AM UTC

Hi Weam, 
Thank you for your interest in Syncfusion products. 
We are not able to reproduce the corruption issue when downloading the PDF in MVC sample. I have attached a working sample for your reference, can you please check this and revert me back with the modified code snippet if you could not fix the issue. 
Regards, 
Karthikeyan 


Loader.
Up arrow icon