Question

What I try to achieve:

Convert a MVC3 view to PDF with abcpdf 8.

It is a result view where I want to cut off party of the views DOM like navigation and other website related parts.

Abcpdf needs, in order to render the html with all css formattings correctly, a absolute url. But I don't want to show the result-pdf view to the user. So how can I access a view from controller by URL without displaying the view. The original result view shall be displayed all the time.

Thank you in advance Christian

Was it helpful?

Solution

You cannot access a View directly with MVC, you have to go through a Controller method. In ASP.NET MVC, URLs map to Controller methods, not to Views.

So if you know the URL of the Controller method that calls the View, you can take that URL and pass it to ABCPDF.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top