Hi,

Looking at the code I do not see Lists supporting margin or padding. I would
suggest trying to wrap the list in a table margins applied to table as
padding as a workaround but it will require you to do postprocessing and
will likely end up ugly. Instead, I would actually extend HTMLWorker and for
list wrap them in a PdfPTable.

Good luck

On Thu, Dec 2, 2010 at 4:28 AM, Jack Black <[email protected]> wrote:

>  Hi again everyone,
>
> UL tag top/bottom/left margins don't seem to work with ParseToList.
>
>  StyleSheet styles = new StyleSheet();
>
>   styles.LoadTagStyle("ul", "style", "line-height: 12px");
>   styles.LoadTagStyle("ul", "margin-left", "10px");
>
>    List<iTextSharp.text.IElement> htmlarraylist =
> iTextSharp.text.html.simpleparser.HTMLWorker.ParseToList(new
> StringReader(text), styles);
>
>     for (int i = 0; i < htmlarraylist.Count; i++)
>       doc.Add(htmlarraylist[i]);
>
> Has anyone got a workaround to indent lists?
>
> Thanks in advance,
> Mischa
>
> ------------------------------
> From: [email protected]
> To: [email protected]
> Date: Wed, 1 Dec 2010 16:46:04 +0100
> Subject: Re: [iText-questions] iTextSharp ParseToList Bulletpoints 5.0.5.0
>
> To reply to my own post.
>
> The html text in the database was missing the ul tags.
>
> :D Sorry
>
> ------------------------------
> From: [email protected]
> To: [email protected]
> Date: Wed, 1 Dec 2010 16:10:14 +0100
> Subject: [iText-questions] iTextSharp ParseToList Bulletpoints 5.0.5.0
>
> Hi everyone :)
>
> HTMLWorker ParseToList seems to intepret tags such as underline, bold an so
> on properly.
> Unfortunately I'm unable to get ul/li bullet points or any other list
> symbol into my PDF report.
>
> Would greatly appreciate some help,
> Mischa
>
> -- snip --
>
> StyleSheet styles = new StyleSheet();
> styles.LoadTagStyle("p", "font-size", "5px");
> styles.LoadTagStyle("ul", "face", "Times");
> styles.LoadTagStyle("ul", "size", "25px");
> styles.LoadTagStyle("ul", "leading", "15f");
> styles.LoadTagStyle("ul", "list-style-type", "square");
> styles.LoadTagStyle("li", "face", "Times");
> styles.LoadTagStyle("li", "size", "25px");
> styles.LoadTagStyle("li", "leading", "15f");
>
> List<iTextSharp.text.IElement> htmlarraylist =
> iTextSharp.text.html.simpleparser.HTMLWorker.ParseToList(new
> StringReader(text), styles);
> string supportedTags =
> iTextSharp.text.html.simpleparser.HTMLWorker.tagsSupportedString;
>
> for(int i = 0; i < htmlarraylist.Count; i++)
> doc.Add(htmlarraylist[i]);
>
> -- snip --
>
> ------------------------------------------------------------------------------
> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap
> into the largest installed PC base & get more eyes on your game by
> optimizing for Intel(R) Graphics Technology. Get started today with the
> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
> http://p.sf.net/sfu/intelisp-dev2dev
> _______________________________________________ iText-questions mailing
> list [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions Many
> questions posted to this list can (and will) be answered with a reference to
> the iText book: http://www.itextpdf.com/book/ Please check the keywords
> list before you ask for examples: http://itextpdf.com/themes/keywords.php
> ------------------------------------------------------------------------------
> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap
> into the largest installed PC base & get more eyes on your game by
> optimizing for Intel(R) Graphics Technology. Get started today with the
> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
> http://p.sf.net/sfu/intelisp-dev2dev
> _______________________________________________ iText-questions mailing
> list [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions Many
> questions posted to this list can (and will) be answered with a reference to
> the iText book: http://www.itextpdf.com/book/ Please check the keywords
> list before you ask for examples: http://itextpdf.com/themes/keywords.php
>
>
> ------------------------------------------------------------------------------
> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
> Tap into the largest installed PC base & get more eyes on your game by
> optimizing for Intel(R) Graphics Technology. Get started today with the
> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
> http://p.sf.net/sfu/intelisp-dev2dev
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Many questions posted to this list can (and will) be answered with a
> reference to the iText book: http://www.itextpdf.com/book/
> Please check the keywords list before you ask for examples:
> http://itextpdf.com/themes/keywords.php
>



-- 
Nurettin DAG
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to