- Home /
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 ();
Just na$$anonymous$$g file .pdf does not make it a pdf file. And I'm unaware of an .NET class that writes the PDF format.
Answer by Baste · Sep 26, 2014 at 08:52 PM
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?
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Save on FileStream using WriteLine 0 Answers
How to move an object over a distance in a direction? 2 Answers