I am trying to use HiQPdf for converting my html code to PDF. but i am getting below error. Even though "HiQPdf.dep" and "HiQPdf.dll" are same location.
An exception of type 'System.Exception' occurred in HiQPdf.dll but was not handled in user code Additional information: Error 0xD8. Check the HiQPdf.dep resource file can be found near the HiQPdf.dll assembly and the user has read and execute permissions for this file. Call SetDepFilePath() method if you placed the HiQPdf.dep in a different location
Below is the method:
// get the HTML code of this view
string htmlToConvert = RenderViewAsString("GetHTMLView", null);
// the base URL to resolve relative images and css
String thisPageUrl = this.ControllerContext.HttpContext.Request.Url.AbsoluteUri;
String baseUrl = thisPageUrl.Substring(0, thisPageUrl.Length - "tblWSRDetails/ConvertWSRReportToPdf".Length);
// instantiate the HiQPdf HTML to PDF converter
HtmlToPdf htmlToPdfConverter = new HtmlToPdf();
// hide the button in the created PDF
htmlToPdfConverter.HiddenHtmlElements = new string[] { "#ConvertReportToPdf" };
// render the HTML code as PDF in memory
byte[] pdfBuffer = htmlToPdfConverter.ConvertHtmlToMemory(htmlToConvert, baseUrl);
// send the PDF file to browser
FileResult fileResult = new FileContentResult(pdfBuffer, "application/pdf");
fileResult.FileDownloadName = "WSR.pdf";
return fileResult;
Please help on the issue.
Regards, Anand