Solved

How to send data to PDF file from VB.NET

Posted on 2010-09-21
3
879 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

759 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

20 Experts available now in Live!

Get 1:1 Help Now