Madan Shekar

Madan Shekar

  • 229
  • 8.3k
  • 1.2m

MVC PDF Generation Issue (Urgent)

Dec 23 2019 11:23 PM
Hi all
 
In mvc application using bellow code i am trying to generate PDF file. The issue is i am not able to generate PDF file , instead of PDF file i am geting bellow response please check. 
 
code :-  
 
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.AddHeader("content-disposition", "attachment; filename=" + docName);
Response.ContentType = "octet-stream";
Byte[] FileBuffer = here byte array (file content)
Response.BinaryWrite(FileBuffer); 
 
Output as of now 
 
 
  
 Thanks In Advance
 Madan 
 

Answers (2)