Solved

How to send data to PDF file from VB.NET

Posted on 2010-09-21
3
887 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 200 total points
ID: 33728555
0
 

Accepted Solution

by:
veve33 earned 300 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

943 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now