' ********************************************************** ' Examples of iTextDotNet in VB.NET: Create RTF-Files ' Chapters: 0803 ' ********************************************************** ' File: CreateRtf.vb ' Author: Klaus Horsten ' Purpose: Create RTF-Examples in VB.NET ' Uses Files (add a reference to): ' iTextdotNET.dll ' JavaRT.dll ' vjslib.dll ' Credits and Copyrights: ' * Original Author and Copyright 2001 - 2003: ' Bruno Lowagie ' See iText Tutorial: ' http://www.lowagie.com/iText/tutorial/ ' * Uses iText .NET: ' Copyright 2002 - 2003 Kazuya Ujihara ' ********************************************************** ' ==================================================================== ' ' This code is free software. It may only be copied or modified ' if you include the following copyright notice: ' ' --> Copyright 2001 by Bruno Lowagie <-- ' ' This code is part of the 'iText Tutorial'. ' You can find the complete tutorial at the following address: ' http://www.lowagie.com/iText/tutorial/ ' ' This code is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ' ' itext@lowagie.com Option Strict On Imports System Imports com.lowagie.text Imports RtfWriter = com.lowagie.text.rtf.RtfWriter Imports java.io Public Class Chap0803 Public Shared Sub Main(ByVal args As String()) Console.WriteLine("Chapter 8 example 3: Lists and RTF") Dim document As New Document() Dim FileOutputStream As FileOutputStream FileOutputStream = New FileOutputStream("Chap0803.rtf") Call RtfWriter.getInstance(document, FileOutputStream) document.open() document.add(New Paragraph("Hello World")) document.add(New Paragraph("some books I really like:")) Dim listItem As ListItem Dim list As List = New List(True, 15) listItem = New ListItem("When Harlie was one", New Font(Font.TIMES_ROMAN, 12)) listItem.add(New Chunk(" by David Gerrold", New Font(Font.TIMES_ROMAN, 11, Font.ITALIC))) list.add(listItem) listItem = New ListItem("The World according to Garp", New Font(Font.TIMES_ROMAN, 12)) listItem.add(New Chunk(" by John Irving", New Font(Font.TIMES_ROMAN, 11, Font.ITALIC))) list.add(listItem) listItem = New ListItem("Decamerone", New Font(Font.TIMES_ROMAN, 12)) listItem.add(New Chunk(" by Giovanni Boccaccio", New Font(Font.TIMES_ROMAN, 11, Font.ITALIC))) list.add(listItem) document.add(list) ' step 5: we close the document document.close() End Sub End Class