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();
}