Wkhtmltopdf.NetCore-deprecated icon indicating copy to clipboard operation
Wkhtmltopdf.NetCore-deprecated copied to clipboard

Exception while trying getting bytearray from view

Open messaddek opened this issue 4 years ago • 2 comments

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.

messaddek avatar Aug 28 '20 13:08 messaddek

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?

fpanaccia avatar Aug 31 '20 00:08 fpanaccia

@messaddek try setting Layout to null:

@{
    Layout = null;
}

gurustron avatar Sep 08 '20 17:09 gurustron