HTMLWorker.parseToList defect ?
- From: "Paulo Soares" <psoares (at) consiste.pt>
- Date: Mon, 4 Dec 2006 10:57:14 -0000
HTMLWorker only works with PDF.
Paulo
> -----Original Message-----
> From: itext-questions-bounces (at) lists.sourceforge.net
> [mailto:itext-questions-bounces (at) lists.sourceforge.net] On
> Behalf Of Alin Popa
> Sent: Monday, December 04, 2006 10:44 AM
> To: itext-questions (at) lists.sourceforge.net
> Subject: [iText-questions] HTMLWorker.parseToList defect ?
>
> Hi,
>
> I think I found one defect in the parseToList static method
> from HTMLWorker.
>
> The problem is like that:
>
> I'm having one html text ('<html><body><font
> color=\"#0000FF\"><b><i>Title One</i></b></font><font
> color=\"black\"><br><br>Some text here<br><br><br><font
> color=\"#0000FF\"><b><i>Another title here
> </i></b></font><font
> color=\"black\"><br><br>Text1<br>Text2<br>Text3<br>Text4<br>
> Text5<br> Text6<br> Text7<br>Text8<br>Text9<br>Text10</body></html>')
>
> String htmlText=HTML Text that I mentioned ;
> RtfFont font = new RtfFont( "Arial" );
> Paragraph para = new Paragraph( "", font );
> StringReader strReader = new StringReader( htmlText );
> ArrayList list = HTMLWorker.parseToList( strReader, null );
> for( int i = 0; i < list.size( ); i++ ) {
> para.add( (Element)list.get( i ) );
> }
> para.setLeading( 0 );
>
> Document doc = new Document( );
> RtfWriter2.getInstance( doc, new FileOutputStream( "test.rtf" ) );
> doc.open();
> doc.add(para);
> doc.close();
>
> I'm running this code and I'm getting one rtf document, BUT,
> at the end of the paragraph I have one Return character.
> For me, this seems to be the problem.
> Is there a possibility for removing that "\n" from the end of
> the Paragraph ?
> A workaround ?
> Is this a bug or this is the design ?
>
> Please let me know, because I need to know ho to make it work.
>
> Thanks in advance.
>
> Alin.
>
>
>
>
> ________________________________
>
> Everyone is raving about the all-new Yahoo! Mail beta.
> <http://us.rd.yahoo.com/evt=45083/*http://advision.webevents.y
> ahoo.com/mailbeta>
>
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.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
iText-questions (at) lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/