예제 #1
0
        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();
 }
예제 #4
0
 public PdfViewController()
 {
     this.htmlViewRenderer = new HtmlViewRenderer();
 }