' Copyright (c) 2003 UJIHARA Kazuya. All rights reserved. ' ' Redistribution and use in source and binary forms, with or without ' modification, are permitted provided that the following conditions ' are met: ' ' 1. Redistributions of source code must retain the above copyright ' notice, this list of conditions and the following disclaimer. ' ' 2. Redistributions in binary form must reproduce the above copyright ' notice, this list of conditions and the following disclaimer in ' the Documentation and/or other materials provided with the ' distribution. ' ' 3. The end-user Documentation included with the redistribution, ' if any, must include the following acknowledgment: ' "This product includes software developed by ' Kazuya Ujihara ." ' Alternately, this acknowledgment may appear in the software itself, ' if and wherever such third-party acknowledgments normally appear. ' ' THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED ' WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ' OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ' DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ' ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ' SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ' LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS OF ' USE, DATA, OR PROFITS OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ' ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ' OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ' OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ' SUCH DAMAGE. ' ==================================================================== ' ' 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 Imports System Imports com.lowagie.text Imports com.lowagie.text.pdf Imports java.io Public Class Chap0207 Public Shared Sub Main(ByVal args As String()) Console.WriteLine("Chapter 2 example 7: font propagation") ' step 1: creation of a document-object Dim Document As New Document() ' step 2: ' we create a writer that listens to the document ' and directs a PDF-stream to a file Dim Writer As PdfWriter = PdfWriter.getInstance(Document, New FileOutputStream("Chap0207.pdf")) ' step 3: we open the document Document.open() ' step 4: ' we add some content Dim myPhrase As New Phrase("Hello 1! ", New Font(Font.TIMES_ROMAN, 8, Font.BOLD)) myPhrase.add(New Phrase("some other font ", New Font(Font.HELVETICA, 8))) myPhrase.add(New Phrase("This is the end of the sentence.\n", New Font(Font.TIMES_ROMAN, 8, Font.ITALIC))) Document.add(myPhrase) myPhrase = New Phrase("Hello 1bis! ", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD)) myPhrase.add(New Phrase("some other font ", FontFactory.getFont(FontFactory.HELVETICA, 8))) myPhrase.add(New Phrase("This is the end of the sentence.\n", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.ITALIC))) Document.add(myPhrase) Dim myParagraph As New Paragraph("Hello 2! ", New Font(Font.TIMES_ROMAN, 8, Font.BOLD)) myParagraph.add(New Paragraph("This is the end of the sentence.", New Font(Font.TIMES_ROMAN, 8, Font.ITALIC))) Document.add(myParagraph) myParagraph = New Paragraph(12) myParagraph.add(New Paragraph("Hello 3! ", New Font(Font.TIMES_ROMAN, 8, Font.BOLD))) myParagraph.add(New Paragraph("This is the end of the sentence.", New Font(Font.TIMES_ROMAN, 8, Font.ITALIC))) Document.add(myParagraph) myPhrase = New Phrase(12) myPhrase.add(New Phrase("Hello 4! ", New Font(Font.TIMES_ROMAN, 8, Font.BOLD))) myPhrase.add(New Phrase("This is the end of the sentence.\n", New Font(Font.TIMES_ROMAN, 8, Font.ITALIC))) Document.add(myPhrase) ' step 5: we close the document Document.close() End Sub End Class