/* * $Id: Chap0707.java,v 1.2 2003/06/29 09:22:28 uzzy Exp $ * $Name: $ * * 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 */ package itext_test.xml; import java.io.FileOutputStream; import com.lowagie.text.Document; import com.lowagie.text.PageSize; import com.lowagie.text.pdf.PdfWriter; import com.lowagie.text.html.HtmlParser; public class HtmlParserExample { public static void main(String[] args) throws Exception { if (!new java.io.File("ParseXML.html").exists()) ParseXML.main(null); System.out.println("Parsing the HTML by HtmlParser"); // step 1: creation of a document-object Document document = new Document(PageSize.A4, 80, 50, 30, 65); // step 2: // we create a writer that listens to the document // and directs a XML-stream to a file PdfWriter.getInstance(document, new FileOutputStream("HtmlParserExample.pdf")); // step 3: we parse the document HtmlParser.parse(document, "ParseXML.html"); } }