Hello!
I have a small problem in asp.net ... I wish to create a pdf file and write text entered into a textbox into it using asp.net. The following lines of code work properly for creating and opening pdf files
Dim fs As FileStream = File.Create(Server.MapPath("files/newfile.doc"))
Dim sw As New StreamWriter(fs)
sw.Write(TextBox1.Text)
sw.Close()
fs.Close()
The only problem is that one I navigate to the folder and open the pdf file, it displays a message saying that the file is corrupt. I am able to open it normally using notepad, but not using pdf.
Can anyone help me out?????
Thanks a lot in advance!