Bulletins and Character numbering in PDF using iTextSharp

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Bulletins and Character numbering in PDF using iTextSharp

Prasath
Hi All,

My question is How to insert a Ordered List <ol>...</ol> tag in a PDF while converting html to PDF?

So far, my code is

List<IElement> htmlarraylist = HTMLWorker.ParseToList(new StringReader(HTMLString), null);
        foreach (iTextSharp.text.IElement elm in htmlarraylist)
        {
            for (int c = 0; c < elm.Chunks.Count; c++)
            {
                elm.Chunks[c].Font = NheaderFont;
            }
            document.Add(elm);
        }

And my sample HTML String will be

<ol style="list-style-type:lower-alpha">
    <li>one</li>
    <li>two</li>
    <li>three</li>
    <li>four</li>
</ol>

And My expected outcome was

a.one
b.two
c.three
d.four

But the result (in PDF file) was

one
two
three
four

Please help me on the above.
Loading...