Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to send data to PDF file from VB.NET

Posted on 2010-09-21
3
Medium Priority
?
933 Views
Last Modified: 2013-12-16
experts,

As a novice to VB.NET, I would like to find out how to print some text strings in my code to produce a PDF file directly. I prefer to use some free PDF add-ins without the need to install a PDF printer. The target PC will have basic PDF reader installed. My source data will only be text-based. However, the size and font of the text needs to be changeable. Samples appreciated!

sew
0
Comment
Question by:sungenwang
3 Comments
 
LVL 18

Assisted Solution

by:John (Yiannis) Toutountzoglou
John (Yiannis) Toutountzoglou earned 800 total points
ID: 33728555
0
 

Accepted Solution

by:
veve33 earned 1200 total points
ID: 33728558
hello,

you can use ItextSharp : http://sourceforge.net/projects/itextsharp/

Hervé
0
 
LVL 5

Expert Comment

by:NKOWA
ID: 33730327
iTextSharp can create text, paragraphs, tables, and images inside PDFs.
iTextSharp is free, open-source, and works with VB.net.

Samples are on sourceforge iTextSharp project website.
http://sourceforge.net/projects/itextsharp/files/

See chapter 1: Example #1
Public Class Chap0101

            Public Sub New()
                  Console.WriteLine("Chapter 1 example 1: Hello World")
                  Dim doc As Document = New Document
                  Try
                        PdfWriter.GetInstance(doc, New FileStream("Chap0101.pdf", FileMode.Create))
                        doc.Open
                        doc.Add(New Paragraph("Hello World"))
                  Catch de As DocumentException
                        Console.Error.WriteLine(de.Message)
                  Catch ioe As IOException
                        Console.Error.WriteLine(ioe.Message)
                  End Try
                  doc.Close
            End Sub
      End Class
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question