Wkhtmltopdf not working on Azure website

I use the https://github.com/codaxy/wkhtmltopdf shell to create a pdf file from a web page on my website (I go to the absolute URL, for example http://mywebsite.azurewebsites.net/PageToRender.aspx He works fine in dev and on another shared hosting account, but when I deploy to the Azure site, it fails, and all I get is a ThreadAbortException exception, Can wkhtmltopdf be used on azure, and if so, what am I doing wrong?

UPDATE: This simple example using Process.Start also does not work. It just freezes when Azure starts up, but works fine on other servers.

string exePath = System.Web.HttpContext.Current.Server.MapPath("\\App_Data\\PdfGenerator\\wkhtmltopdf.exe"); string htmlPath = System.Web.HttpContext.Current.Server.MapPath("\\App_Data\\PdfGenerator\\Test.html"); string pdfPath = System.Web.HttpContext.Current.Server.MapPath("\\App_Data\\PdfGenerator\\Test.pdf"); StringBuilder error = new StringBuilder(); using (var process = new Process()) { using (Stream fs = new FileStream(pdfPath, FileMode.Create)) { process.StartInfo.FileName = exePath; process.StartInfo.Arguments = string.Format("{0} -", htmlPath); process.StartInfo.RedirectStandardOutput = true; process.StartInfo.RedirectStandardError = true; process.StartInfo.UseShellExecute = false; process.Start(); while (!process.HasExited) { process.StandardOutput.BaseStream.CopyTo(fs); } process.WaitForExit(); } } 
+4
source share
1 answer

Check out this question about a similar issue. This guy seems to have earned. RotativaPDF is built on top of wkhtmltopdf, hence the connection. I am in the process of testing on my Azure site - I will publish my results in the near future.

Azure and Rotativa PDF print for ASP.NET MVC3

0
source

All Articles