Bulletins and Character numbering in PDF using iTextSharp c#

488 views Asked by At

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.

0

There are 0 answers