' ********************************************************** ' Examples of iTextDotNet in VB.NET: Create RTF-Files ' Chapters: 0804 ' ********************************************************** ' 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 Chap0804 Public Shared Sub Main(ByVal args As String()) Console.WriteLine("Chapter 8 example 4: Tables and RTF") Dim document As New Document() Try Dim FileOutputStream As FileOutputStream FileOutputStream = New FileOutputStream("Chap0804.rtf") RtfWriter.getInstance(document, FileOutputStream) document.open() Dim table As Table = New Table(3) table.setBorderWidth(1) table.setPadding(5) table.setSpacing(5) Dim cell As Cell = New Cell("header") cell.setHeader(True) cell.setColspan(3) table.addCell(cell) cell = New Cell("example cell with colspan 1 and rowspan 2") cell.setRowspan(2) table.addCell(cell) table.addCell("1.1") table.addCell("2.1") table.addCell("1.2") table.addCell("2.2") table.addCell("cell test1") cell = New Cell("big cell") cell.setRowspan(2) cell.setColspan(2) table.addCell(cell) table.addCell("cell test2") document.add(table) Catch ee As Exception Console.WriteLine(ee.ToString()) End Try document.close() End Sub End Class