fpanaccia / Wkhtmltopdf.NetCore-deprecated

Rotativa + Net Core
The Unlicense
220 stars 94 forks source link

Exception while trying getting bytearray from view #28

Open messaddek opened 4 years ago

messaddek commented 4 years ago

Hello, i'm trying to run the tool to generate pdf from razor view, but i am getting this error ;

Could not find an IRouter associated with the ActionContext. If your application is using endpoint routing then you can get a IUrlHelperFactory with dependency injection and use it to create a UrlHelper, or use Microsoft.AspNetCore.Routing.LinkGenerator.

PS: I am running this from a controller.

Please help.

fpanaccia commented 4 years ago

Hi! did you see the example project? https://github.com/fpanaccia/Wkhtmltopdf.NetCore.Example

Could you upload an example of how you are using it?

gurustron commented 4 years ago

@messaddek try setting Layout to null:

@{
    Layout = null;
}