I am adding a CSS stylesheet to my PDF creation with iTextSharp.
My code looks like this:
var css = XMLWorkerHelper.GetCSS(new FileStream(HttpContext.Current.Server.MapPath(linkCss), FileMode.Open));
cssResolver.AddCss(css);
And my CSS is simple like this:
.test-class {
color: orange;
}
However, when I add this style sheet, it is not being applied. I dug into the CSSFileWrapper
private properties while debugging, and noticed the key/value generated for .test-class
actually had a key of .test-class
For whatever reason, the first (and only first) CSS class in the stylesheet has those strange characters at the beginning of the key name. The rest of the styles in the parsed document are correct. Right now, I just added a dummy class at the beginning to account for this, but I feel there is some other underlying issue.
Does anyone know what would cause this?