creating pdf files

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2007
Posts: 28
Reputation: nice_true is an unknown quantity at this point 
Solved Threads: 0
nice_true nice_true is offline Offline
Light Poster

creating pdf files

 
0
  #1
Nov 4th, 2008
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

  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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: creating pdf files

 
0
  #2
Nov 4th, 2008
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
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 144
Reputation: sierrainfo is an unknown quantity at this point 
Solved Threads: 9
sierrainfo sierrainfo is offline Offline
Junior Poster
Join Date: Dec 2004
Posts: 4,191
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 485
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: creating pdf files

 
0
  #4
Nov 28th, 2008
Originally Posted by sierrainfo View Post
http://asp-net-whidbey.blogspot.com/...textsharp.html

http://www.developerfusion.com/code/...s-on-fly-in-c/


hope it will help u
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
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC