Solved

How to send data to PDF file from VB.NET

Posted on 2010-09-21
3
906 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

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…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

623 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