Click here to Skip to main content
12,078,090 members (48,645 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB VB.NET
I have Vb.net application that generates a form using Excel i also need to generate in PDF how can i do this?
Posted 20-Nov-12 12:02pm
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?
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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:

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
  Permalink  
Comments
Sergey Alexandrovich Kryukov 20-Nov-12 17:34pm
   
Lacks some references; please see my answer...
--SA
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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
  Permalink  
v3

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web04 | 2.8.160212.1 | Last Updated 21 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100