Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have Vb.net application that generates a form using Excel i also need to generate in PDF how can i do this?
Posted
Comments
Kschuler 20-Nov-12 17:06pm    
There are lots of ways and lots of third party components that help with PDFs. You really haven't supplied enough information for us to recommend anything. Provide more information about your project. What have you looked into and why did or didn't you want to go that route? Have you googled for help and done research on this first?

First of all you need to download "iTextSharp" from: iTextSharp

After that,extract iTextSharp and you need to add reference to file itextsharp.dll Chose right click on project-->add reference-->browse and browse to the extracted folder.

Now,you need to create pdf file on c:\ drive using this code:

VB
Using fs As New IO.FileStream("c:\file.pdf", IO.FileMode.Create)
Using doc As New Document
Dim pdfWriter As pdf.PdfWriter = iTextSharp.text.pdf.PdfWriter.GetInstance(doc, fs)             
doc.Open()
doc.Add(New Paragraph("Now pdf file is created and you can input what you need!"))
doc.Close()
End Using
End Using
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 20-Nov-12 17:34pm    
Lacks some references; please see my answer...
--SA
Some links to help you with iText suggested in Solution 1:
http://en.wikipedia.org/wiki/IText[^],
http://itextpdf.com/[^] (even though this is Java, most documentation is here),
http://sourceforge.net/projects/itextsharp/[^] (and this is .NET port of it, iTestSharp; this is what you would use).

—SA
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900