I'm using iTextSharp
for converting a HTML
page to PDF
. I'm making use of the helper class given here and I've also tried to make use of StyleSheet.LoadTagStyle()
to apply CSS. But nothing seems to work. Any insights?
EDIT
I'm able to add styles like this -
.mystyle
{
color: red;
width: 400px;
}
With the following code -
StyleSheet css = new StyleSheet();
css.LoadStyle("mystyle", "color", "red");
css.LoadStyle("mystyle", "width", "400px");
But what happens when I’ve complex styles like this?
div .myclass
{
/*some styles*/
}
td a.hover
{
/*some styles*/
}
td .myclass2
{
/*some styles*/
}
.myclass .myinnerclass
{
/*some styles*/
}
How to add it using iTextSharp?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…