Exemplo n.º 1
0
        protected override byte[] CallTheDriver(ControllerContext context)
        {
            // use action name if the view name was not provided
            string viewName = ViewName;

            if (string.IsNullOrEmpty(viewName))
            {
                viewName = context.RouteData.GetRequiredString("action");
            }

            ViewEngineResult viewResult = GetView(context, viewName, MasterName);
            string           html       = context.GetHtmlFromView(viewResult, viewName, Model);

            byte[] fileContent = WkhtmltopdfDriver.ConvertHtml(this.WkhtmlPath, this.GetConvertOptions(), html);
            return(fileContent);
        }
Exemplo n.º 2
0
 protected override byte[] WkhtmlConvert(string switches)
 {
     return(WkhtmltopdfDriver.Convert(this.WkhtmlPath, switches));
 }