title: Creating pdf from byte array
body: <p>I am trying to create a pdf file from a byte array as </p>
  
  <pre><code>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);
   }
  </code></pre>
  
  <p>It creates the file. However, when I try to open the file, I get the following error:</p>
  
  <pre><code>adobe reader could not open file because it is not a supported file type
  </code></pre>
  
  <p>I can open other pdf files just fine. What is causing this error?</p>