I need to generate a PDF document that includes simple text, as well as parsing a number of html documents that should be displayed in various parts of the pdf document.
If i use HTMLParser to parse a html document in the middle of creating the pdf, the document instance gets closed and no further elements can be added to it. If i use HTMLWorker, even though i want the html to be displayed in different sections of the pdf document, the html output is concatenated and appears the first time the "parse" code is called. Could someone please recommend an alternative way of doing this? Sample code: Document document = new Document(PageSize.A4, 40, 40, 72, 72 ); PdfWriter.getInstance(document , new FileOutputStream("/online/pdf/text.pdf")); this.document.open(); MultiColumnText mct = new MultiColumnText(); mct.addRegularColumns(document.left(), document.right(), 10f, 2); mct.addElement( new Paragraph( leading, "PART B: PROPOSED COURSE PROFILE", headingFont ) ); mct.addElement( new Paragraph( leading, "\n" ) ); new HTMLWorker(document).parse(new FileReader(htmlFile)); mct.addElement( new Paragraph( leading, "PART C: PROPOSED COURSE PROFILE", headingFont ) ); mct.addElement( new Paragraph( leading, "\n" ) ); new HTMLWorker(document).parse(new FileReader(anotherHtmlFile)); etc All assistance is appreciated. Kathryn -- This message was sent on behalf of [EMAIL PROTECTED] at openSubscriber.com http://www.opensubscriber.com/message/itext-questions@lists.sourceforge.net/10247011.html ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php