[RESOLVED]Download form to Pdf on button click

Can anyone help me download the selected form on button click to pdf  in MVC ….

or anyother way to do it.

So you need to convert a form to PDF?  I use the NuGet package "Rotativa" to convert anything to PDF.  There’s good documentation on it as well


How to add it in my project???

can u suggest me pls


You can use Nuget to install it. Go to the Nuget console manager and run the command (as mentioned in the post)

Install-Package Rotativa

For information on how to run Nuget from console see the below post


i have installed Rotativa in my project..

but i m not able to proceed furthur;

can u provide me with sample video for downloading form on button click

Try downloading the demo from the site and run it


I m getting this error how do i resolve it?

Error 19 The type or namespace name ‘ControllerContext’ could not be found (are you missing a using directive or an assembly reference?) E:PersonalInformationLearningAjaxRotativa-PartialViewAsPdfRotativa-PartialViewAsPdfRotativaAsPdfResultBase.cs 229
44 Rotativa

Can you explain little bit more on what you want to do on the button click. What data you want to convert into pdf and where does this data reside?

Also are you ok with use commercial products which will simplify your work?

I have two buttons on everypage when i view data of a particular client …..print button and download button//…..

print is ok…

now i need code for downloading the particular html page to pdf ……

can u help me with this?

Is it ok to pass your data to a third party website which converts your page to pdf. If yes try this

<a href="javascript:void(window.open('http://www.htmltopdfconverter.net/?convert='+window.location))">Convert To PDF</a>

Also check this stack overflow
convert HTML ( having Javascript ) to PDF using java / javascript

Leave a Reply