Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We are using Rotativa in a .Net MVC 5 project. it works like a charm locally and fails (generates a blank PDF) equally when deployed to server. However, if I login to server and access the website as localhost it generates PDF just fine.

So it looked like a permission issue with which Application pool is running on. So, for testing purpose, I changed to run the App Pool to run on "Local System". Still same issue.

We have also tried:

"ViewasPDF"
App settings which looks like: <add key="WkhtmltopdfPath" value="<path to the folder>">
Below is the code:

return new ActionAsPdf("ActionMethod",new { id = id, partSelected = part, selectedTab = selectedTab, isDownload = true })
{
FileName = fileName,
PageMargins = { Left = 0, Right = 0 },
CustomSwitches = "--disable-external-links --disable-internal-links --disable-smart-shrinking --viewport-size 1600x900 --load-error-handling ignore",
PageOrientation = Rotativa.Options.Orientation.Portrait,
PageSize = Rotativa.Options.Size.A4,
PageWidth = 210,
PageHeight = 297
};
Posted
Updated 18-May-18 18:56pm

1 solution

See Whether that view/html you are passing is rendering as Empty. Which server are using?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900