public System.Web.Mvc.ActionResult BinaryPdfData(System.Web.Mvc.Controller ctrlr, string pageTitle, string viewName, object model)
        {
            this.htmlViewRenderer = new HtmlViewRenderer();

            // Render the view html to a string.
            string htmlText = htmlViewRenderer.RenderViewToString(ctrlr, viewName, model);

            // Let the html be rendered into a PDF document through iTextSharp.
            byte[] buffer = RenderW(htmlText, pageTitle);

            // Return the PDF as a binary stream to the client.
            return new BinaryContentResult(buffer, "application/pdf");
        }
 public PdfViewController()
 {
     this.htmlViewRenderer    = new HtmlViewRenderer();
     this.standardPdfRenderer = new StandardPdfRenderer();
 }
 public PdfViewController()
 {
     this.htmlViewRenderer = new HtmlViewRenderer();
     this.standardPdfRenderer = new StandardPdfRenderer();
 }
Beispiel #4
0
 public PdfViewController()
 {
     this.htmlViewRenderer = new HtmlViewRenderer();
 }