The pdf is getting generated in local but it is corrupted .The message is 'adobe reader could not open because it is either not supported or damaged'.Below is the code i am using .The binary content is a pdf content for sure .Please help ......
string path= "E:/J/test1.pdf";
byte[] binrydata = System.Convert.FromBase64String(content);
binrydata = Encoding.ASCII.GetBytes(content)
System.IO.FileStream stream = new System.IO.FileStream(path, System.IO.FileMode.Create);
stream.Write(binrydata, 0, binrydata.Length);
stream.Close();