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();
If your IIS version is 7.5 or higher, then the exception message which we should focus may be "this operation requires iis integrated pipeline mode"
I found this answer from this link http://forums.asp.net/t/1253457.aspx
As the error message indicated, it requires IIS integrated pipeline mode. Please select the application pool in IIS Manager, Click "Basic Settings..." and make sure "Integrated" mode is selected for "Managed pipeline mode" in the dialog.
Could you please check that?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.