Rotativa locally works fine but it's unable to redirect the view in the server

657 Views Asked by At

Rotativa locally works fine but it's unable to redirect to the desired view to print in the server

enter image description here

1

There are 1 best solutions below

0
On

Few things to check here:

  1. Rotativa uses wkhtmltopdf, check if it is installed on server.
  2. you can just copy the 2 following dll files to the Rotativa folder (in root location of project) on the server if you don't want to / can't easily install things on the server, i.e., msvcr120.dll and msvcp120.dll

Check similar question/answers here

https://stackoverflow.com/a/50066692/3559462

https://stackoverflow.com/a/36877635/3559462

https://stackoverflow.com/a/27942678/3559462

(razor to pdf using rotativa or itextsharp): https://qawithexperts.com/article/asp.net/export-html-to-pdf-in-aspnet-mvc-using-itextsharp-or-rotativ/94

I recommend you add "Rotativa" folder in the root of your application and add these files

help-wkhtmltoimage.txt
help-wkhtmltopdf.txt
msvcp120.dll
msvcp140.dll
msvcr120.dll
vcruntime140.dll
wkhtmltoimage.exe
wkhtmltopdf.exe
wkhtmltox.dll

As suggested here https://stackoverflow.com/a/48711643/3559462