As the subject says, I’m having issues using HtmlInfo.ExternalResourcesBasePath for CSS links. The value I’m applying to that property is working when I apply it to HtmlInfo.ImgUrl.
So, imagine the following:
var basePath = “[http://domain](http://domain/)”;
var pdf = new Pdf {
HtmlInfo = {
ImgUrl = basePath,
ExternalResourcesBasePath = basePath,
}
};
var section = pdf.Sections.Add();
var text = new Text(section, htmlString) {
IsHtmlTagSupported = true,
IsHtml5Supported = true // tried with and without this
};
section.Paragraphs.Add(text);
The HTML I’m using to create the PDF has the following element in the tag:
…and the following element in the tag:
When I create a PDF, the image is properly found and loaded, but the CSS is NOT applied. If I view the page itself in a browser (without converting it to a PDF), the CSS IS applied.
I should also note that I’ve tried stripping “bootstrap.css” down to a couple simple styles to make sure something unsupported wasn’t breaking the use of the stylesheet, and it still didn’t work.
Am I missing something? Any direction or help would be greatly appreciated!
EDIT: I wrote this based on suggestions found on this page