Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

Exception while trying getting bytearray from view #28

Open
messaddek opened this issue Aug 28, 2020 · 2 comments
Open

Exception while trying getting bytearray from view #28

messaddek opened this issue Aug 28, 2020 · 2 comments

Comments

@messaddek
Copy link

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
Copy link
Owner

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
Copy link
Contributor

@messaddek try setting Layout to null:

@{
    Layout = null;
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants