asp.net mvc - RazorPDF save pdf file to server directory in MVC4 -
i assembling , displaying pdf using razorpdf in mvc4 , save pdf file file system @ same time return view. the following line of code in controller action calling view: return new pdfresult(claims, "pdf"); i able write pdf directory system changing code base of razorpdf render method. rendor method creates pdfwriter object associated response stream: // associate output response stream var pdfwriter = pdfwriter.getinstance(document, viewcontext.httpcontext.response.outputstream); pdfwriter.closestream = false; the solution create pdfwriter object associated filestream object illustrated below: // create pdf file in directory system var filestream = new filestream(mypdffilepath, filemode.create); var pdfwriter2 = pdfwriter.getinstance(document, filestream); i closed objects: filestream.close(); pdfwriter.close(); pdfwriter2.close(); i had incorporate pdfresult , pdfview classe