943,634 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 1470
  • ASP.NET RSS
Nov 4th, 2008
0

creating pdf files

Expand Post »
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

asp.net Syntax (Toggle Plain Text)
  1. Dim fs As FileStream = File.Create(Server.MapPath("files/newfile.doc"))
  2. Dim sw As New StreamWriter(fs)
  3. sw.Write(TextBox1.Text)
  4. sw.Close()
  5. 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!
Last edited by peter_budo; Nov 5th, 2008 at 9:14 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
nice_true is offline Offline
28 posts
since Sep 2007
Nov 4th, 2008
0

Re: creating pdf files

you are creating a file with a pdf extension, not an actual pdf file

you need to use a either a converter or a printer to create the file

i normally use pdf995.com
Reputation Points: 133
Solved Threads: 141
Veteran Poster
dickersonka is offline Offline
1,162 posts
since Aug 2008
Reputation Points: 10
Solved Threads: 9
Junior Poster
sierrainfo is offline Offline
144 posts
since May 2008
Nov 28th, 2008
0

Re: creating pdf files

This will not help at all! It is only small fraction of whole image behind PDF creation with iText library which has port to C#.
For full resources please go to iTextSharp
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 871
Code tags enforcer
peter_budo is offline Offline
6,654 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: error on search code
Next Thread in ASP.NET Forum Timeline: delete a record from sql server database...





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC