Html to PDF - adding css link

We are evaluating your PDF library to purchase ASAP, but we need to make sure it can handle the requests that we are needing to fill prior to purchasing.

I'm rendering from an ASP.net XMLControl and it works fine until I embed a stylesheet link and set the "ExternalResourcesBasePath", and the call to "PDF.BindToHTML" results in "Object not set to an instance of an object" error. If i comment out the "link" and ExternalResourcesBasePath, the code works again.

I would appreciate any guidance...

protected void btnPDF_Click(object sender, EventArgs e)
{
StringWriter stringWriter = new StringWriter();
HtmlTextWriter htmlTextWriter = new HtmlTextWriter(stringWriter);
XmlControl.RenderControl(htmlTextWriter);

string htmlToRender = stringWriter.ToString();

htmlToRender = htmlToRender.Replace("","");

var pdf = new Pdf();

pdf.HtmlInfo.ExternalResourcesBasePath = Server.MapPath("~/css/");
pdf.BindHTML(htmlToRender);

var memoryStream = new MemoryStream();

pdf.Save(memoryStream);
Response.Clear();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment;filename=Stacy.pdf");
Response.BinaryWrite(memoryStream.ToArray());
Response.Flush();
Response.End();

}

Hi Sprig,

Thanks for using our products and sharing the sample source code with us.

Kindly visit the following documentation link for more details and code snippets as per your requirement.

How to convert HTML to PDF using InLineHTML approach

If you still face any issue, please share the source HTML and CSS files with us so that we can test the scenario at our end. This will help us to figure out the exact issue and reply back to you soon.

We apologize for your inconvenience.

Thanks & Regards,