Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: 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 11:02am
Comments
Kschuler at 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 at 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
0 OriginalGriff 210
1 Richard MacCutchan 100
2 kbrandwijk 90
3 ProgramFOX 80
4 Mukesh Bhagat 65
0 Sergey Alexandrovich Kryukov 9,050
1 OriginalGriff 8,151
2 CPallini 2,613
3 Richard MacCutchan 2,221
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web03 | 2.8.140827.1 | Last Updated 21 Nov 2012
Copyright © CodeProject, 1999-2014
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