Ejemplo n.º 1
0
        public ActionResult PdfWithoutLayout()
        {
            var generator = new MvcGenerator(ControllerContext, Server.MapPath("~"));
            var pdf       = generator.GeneratePdf(GetModel(), "PdfWithoutLayout");

            return(new FileContentResult(pdf, "application/pdf"));
        }
Ejemplo n.º 2
0
        public ActionResult PdfWithLayout()
        {
            var generator = new MvcGenerator(ControllerContext, Server.MapPath("~"));

            var model = new FooterModel
            {
                Name = "Unicorns Rule"
            };

            var snippet = new Footer(model, "~/Views/Pdf/_Footer.cshtml", 50, 5, 5, 10);

            generator.AddPageSnippet(snippet);

            var pdf = generator.GeneratePdf(GetModel(), "PdfWithLayout");

            return(new FileContentResult(pdf, "application/pdf"));
        }
Ejemplo n.º 3
0
        public ActionResult Imprimir()
        {
            /*
             * if (usuario_id > 0)
             * {
             *  usuario = new Usuario().Obtener(usuario_id);
             * }
             */
            int hojavida_id = ObtenerHojaVidaId(0);

            HojaVida hoja = new HojaVida();

            hoja = hojavida.Obtener(hojavida_id);

            ViewData["hojavidadocentefa"]  = hojavidadocentefa.Listar(usuario.Persona.persona_id);
            ViewData["hojavidadocentefc"]  = hojavidadocentefc.Listar(usuario.Persona.persona_id);
            ViewData["hojavidadocenteex"]  = hojavidadocenteex.Listar(usuario.Persona.persona_id);
            ViewData["hojavidadocentecrp"] = hojavidadocentecrp.Listar(usuario.Persona.persona_id);

            var generator = new MvcGenerator(ControllerContext);
            var pdf       = generator.GeneratePdf(hoja, "Imprimir");

            return(new FileContentResult(pdf, "application/pdf"));
        }