How to write string value to pdf file in unity3d

I am getting txt file without any additional namespace but i am not getting in pdf formate.
please any one …

Thanks.

string message=“hi this is pdf formate”;
System.Text.UnicodeEncoding encod = new System.Text.UnicodeEncoding();

    			byte[] byteData = encod.GetBytes(message);
    			
    			System.IO.FileStream oFileStream = null;
    			oFileStream = new System.IO.FileStream("D:\\DoneFile.pdf", System.IO.FileMode.Create);
    			oFileStream.Write(byteData, 0, byteData.Length);
    			oFileStream.Close ();

Yup, naming a file .something does not make it that something. PDF is a pretty complicated format, and it’s not exactly made to be edited.

You could probably have your script make some LaTeX code, and then have LaTeX compile it down to a PDF through some system calls. That’s probably a bit more work than you expected, though.

What exactly are you trying to achieve, by the way?