HTMLWorker.parseToList().
Paulo
________________________________________
From: [EMAIL PROTECTED] [EMAIL PROTECTED]
Sent: Wednesday, September 24, 2008 12:53 PM
To: [email protected]
Subject: Re: [iText-questions] (no subject)
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
Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
informação confidencial ou legalmente protegida. A incorrecta transmissão desta
mensagem não significa a perca de confidencialidade. Se esta mensagem for
recebida por engano, por favor envie-a de volta para o remetente e apague-a do
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de
usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may contain
confidential or legally protected information. The incorrect transmission of
this message does not mean the loss of its confidentiality. If this message is
received by mistake, please send it back to the sender and delete it from your
system immediately. It is forbidden to any person who is not the intended
receiver to use, distribute or copy any part of this message.
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php