I am using Rotativa tool to display pdf. It works fine on localhost, But does not work on Azure platform

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 12:54:48

Like (#Fabrizio Accatino) wrote: Rotativa is running wkhtmltopdf.exe. It is located in "Rotativa" folder under the root of your project. So the issue could be:

  1. During the deployment - the Rotativa folder is not created (ensure that you've added the folder and the .exe in the project and set the property of the file as "copy always").
  2. There are missing libraries on the server (ensure that there are presented on the server - msvcp120.dll and msvcr120.dll /under sysWOW64 folder/)
  3. Ensure that the app pool user have the needed permissions to run the executable and to store the temp .pdf file.
  4. Ensure that the path name does not exceed the max length (250 digits I think).

I hope this will guide you for solving the problem.

I had the same problem, I managed to solve just by upgrading to the 1.6.3 version of rotating. Follow the link nuget: [https://www.nuget.org/packages/Rotativa/1.6.3] [1]


In the package Manager Console, type:

  1. Uninstall-Package Rotating press ENTER.
  2. Install-Package Rotating-Version 1.6.3 press ENTER.
  3. Check in the rotating folder, if you are now just the file * * wkhtmltopdf. exe * *.

Remark

In the 1.6.3 version the rotating no longer uses the files:

  1. libeay32. dll
  2. LIBGCC_S_DW2-1. dll
  3. MINGWM10. dll
  4. README. txt
  5. ssleay32. dll

It uses only the following file:

  1. wkhtmltopdf. exe

However, when upgrading to this new version, the rotating updates only this file wkhtmltopdf.exe to the new one, replacing it.

Now just rotate it again and it will work again.

[1]: Rotating upgrading to the 1.6.3 version

I think only premium accounts on azure allow to run wkhtmltopdf.exe on server or you can also create rotative pdf using this https://rotativahq.com/

Hope this help anyone !

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!