You are missing the <UL></UL>. The styles are used as a kind of poor
man's CSS, what you put there will be associated with the tag. For
example:
style.loadTagStyle("a", "color", "blue");
style.loadTagStyle("a", "u", "");
will make all the links underline blue.
style.loadStyle("NavBar", "size", "8px")
will make all appearances of "class=NavBar" be replaced with that style
or styles with the same name. The style "body" is special and is applied
at the beginning of the parsing and acts as a doc default.
Best Regards,
Paulo Soares
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Mark Hitchcock
> Sent: Tuesday, February 22, 2005 8:06 AM
> To: [email protected]
> Subject: RE: [iText-questions] HTMLWorker
>
> Thanks Paulo,
>
> I have something sort of working...
>
> Having trouble getting a list to display correctly in the pdf
> from the html
> string, am I using the style.loadTagStyle("li", "", "");
> correctly for html
> lists? Not sure how to use this correctly for fonts either?
> Any suggestions
> for the html below.
>
> <font face="Arial" size="10" color="#15325C">
> <p>A paragraph.</p>
> <li>List item.</li>
> <li>List item.</li>
> <li>List item.</li>
> <p>Another paragram.</p>
> </font>
>
> Thanks
> Mark
>
>
>
>
> -----Original Message-----
> From: Paulo Soares [mailto:[EMAIL PROTECTED]
> Sent: Monday, 21 February 2005 6:01 PM
> To: Mark Hitchcock; [email protected]
> Subject: RE: [iText-questions] HTMLWorker
>
> You have it right with HTMLWorker. About the rest:
>
> PdfContentByte cb = pdfWriter.getDirectContent();
>
> ColumnText ct = new ColumnText(cb);
> ct.setSimpleColumn(...);
> ct.setYLine(...);
> if (list != null) {
> for (int i=0; i < list.size(); i++) {
> ct.addElement((Element)list.get(i));
> }
> }
> ct.go();
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On
> Behalf Of Mark
> > Hitchcock
> > Sent: Monday, February 21, 2005 6:47 AM
> > To: [email protected]
> > Subject: [iText-questions] HTMLWorker
> >
> > Does anyone have an example of HTMLWorker in action. I am
> struggling
> > with how to add elements to the document after they are
> parsed into an
> > ArrayList.
> > I have attached some code below and hopefully someone will
> be able to
> > help me work through it or have an existing example.
> >
> > ****************
> >
> > Document document = new Document();
> > ByteArrayOutputStream baos = new ByteArrayOutputStream(); PdfWriter
> > pdfWriter = PdfWriter.getInstance(document, baos);
> >
> > document.open();
> >
> > StyleSheet style = new StyleSheet();
> > style.loadTagStyle("li", "", "");
> > style.loadTagStyle("p", "", "");
> > StringReader sr = new StringReader(html_field_from_db);
> ArrayList list
> > = HTMLWorker.parseToList(sr, style);
> >
> > PdfContentByte cb = pdfWriter.getDirectContent();
> >
> > if (list != null) {
> > for (int i=0; i < list.size() - 1; i++) {
> > ColumnText ct = new ColumnText(cb);
> > ct.addElement();
> > ct.go();
> > }
> > }
> >
> > document.close();
> >
> > ****************
> >
> >
> > Thanks
> > Mark Hitchcock
> >
> >
> >
> >
> > -------------------------------------------------------
> > SF email is sponsored by - The IT Product Guide Read honest
> & candid
> > reviews on hundreds of IT Products from real users.
> > Discover which products truly live up to the hype. Start
> reading now.
> > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> > _______________________________________________
> > iText-questions mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/itext-questions
> >
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from
> real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions