I am trying to create a pdf file from a byte array as
string str = "Hello World";
byte[] byteArray = Encoding.ASCII.GetBytes(str);
using(FileStream fs = new FileStream(path, FileMode.OpenorCreate, FileAccess.ReadWrite, FileShare.None))
{
fs.Write(byteArray, 0, byteArray.Length);
}
It creates the file. However, when I try to open the file, I get the following error:
adobe reader could not open file because it is not a supported file type
I can open other pdf files just fine. What is causing this error?