I'm using winnovative PDF converter and its working properly on my test project. but when i add same code to my original project,
shows that it throws following exceptions.
i checked value of
HttpResponse httpResponse = HttpContext.Current.Response;
and it shows values as above content.
how can I solve this. I tried this even after hosting in IIS server as well.
Edit:
byte[] pdfBytes = pdfConverter.GetPdfBytesFromUrl(htmlWithSvgUrl);
HttpResponse httpResponse = HttpContext.Current.Response;
// add the Content-Type and Content-Disposition HTTP headers
httpResponse.AddHeader("Content-Type", "application/pdf");
httpResponse.AddHeader("Content-Disposition", String.Format("attachment; filename=SvgToPdf.pdf; size={0}", pdfBytes.Length.ToString()));
// write the PDF document bytes as attachment to HTTP response
httpResponse.BinaryWrite(pdfBytes);
// Note: it is important to end the response, otherwise the ASP.NET
// web page will render its content to PDF document stream
//httpResponse.End();
HttpContext.Current.ApplicationInstance.CompleteRequest();