Hi,
I'm html page with table of content to pdf. Numbering is handled by css and hierarchical ol/li structure. but is not visible in output file. I'm doing this with following code:
var options = new HtmlLoadOptions();
string htmlContent = @"
<html>
<head>
<style type=""text/css"">
.TableOfContent ol {
counter-reset: item;
list-style-type: none;
margin: 0;
padding: 0;
}
.TableOfContent li {
counter-increment: item;
display: table;
}
.TableOfContent li > a {
line-height: 1.5em;
}
.TableOfContent li:before {
content: counters(item, ""."") "". "";
display: table-cell;
padding-right: 0.6em;
}
.TableOfContent li li {
margin: 0;
}
.TableOfContent li li:before {
content: counters(item, ""."") "" "";
}
</style>
</style>
</head>
<body>
<div class=""TableOfContent"">
<ol >
<li ><a href=""#"">Details</a>
<ol>
<li ><a href=""#"">Service</a></li>
<li><a href=""#"">Level</a></li>
<li><a href=""#"">Services</a>
<ol>
<li><a href=""#"">SM</a></li>
<li><a href=""#"">SA</a></li>
<li><a href=""#"">SP</a></li>
</ol>
</li>
</ol>
</li>
<li ><a href=""#"">Details2</a>
<ol>
<li ><a href=""#"">Service2</a></li>
<li><a href=""#"">Level2</a></li>
<li><a href=""#"">Services2</a>
<ol>
<li><a href=""#"">SM</a></li>
<li><a href=""#"">SA</a></li>
<li><a href=""#"">SP</a></li>
</ol>
</li>
</ol>
</li>
</ol>
</div>
</body>
</html>
";
using (var memoryStream = new MemoryStream(Encoding.UTF8.GetBytes(htmlContent)))
{
var pdfDocument = new Document(memoryStream, options);
pdfDocument.Save("HTMLToPDF_List.pdf");
}
Is there any workaround to achieve this?
Best regards,
Gabriel