private static void SetHead(HeaderGolf header) { float legalMarginWidth = ItextUtils.CentimetersToPoints(33.02F); float legalMarginHeight = ItextUtils.CentimetersToPoints(21.59F); float marginLeft = ItextUtils.CentimetersToPoints(1); float marginRight = ItextUtils.CentimetersToPoints(1); float marginTop = ItextUtils.CentimetersToPoints(1); float marginBottom = ItextUtils.CentimetersToPoints(4); documentPdf = new Document(); documentPdf.SetPageSize(PageSize.LETTER.Rotate()); documentPdf.SetMargins(marginLeft, marginRight, marginTop, marginBottom); PdfWriter writer = PdfWriter.GetInstance(documentPdf, new FileStream(path, FileMode.Create)); header.Deporte = "golf"; header.HasLeyenda = false; header.User = "";// user.Username; header.NombreReporte = "Resultados Finales."; header.LogoDerecha = Image.GetInstance(string.Format(@"{0}\Golf\{1}", pathImage, "golf.png")); header.LogoIzquierda = Image.GetInstance(string.Format(@"{0}\Golf\{1}", pathImage, "Federacion.png")); header.LogoAbajoDerecha = Image.GetInstance(string.Format(@"{0}\Hammer\{1}", pathImage, "marcaDoble.png")); header.LogoAbajoIzquierda = Image.GetInstance(string.Format(@"{0}\Hammer\{1}", pathImage, "hammerLogoH.png")); header.leyendas = null; writer.PageEvent = header; documentPdf.Open(); }
public static void SetHead(string delegacion) { float legalMarginWidth = ItextUtils.CentimetersToPoints(33.02F); float legalMarginHeight = ItextUtils.CentimetersToPoints(21.59F); float marginLeft = ItextUtils.CentimetersToPoints(1); float marginRight = ItextUtils.CentimetersToPoints(1); float marginTop = ItextUtils.CentimetersToPoints(1); float marginBottom = ItextUtils.CentimetersToPoints(4); documentPdf = new Document(); documentPdf.SetPageSize(PageSize.LETTER); documentPdf.SetMargins(marginLeft, marginRight, marginTop, marginBottom); PdfWriter writer = PdfWriter.GetInstance(documentPdf, new FileStream(path, FileMode.Create)); HeaderReport header = new HeaderReport(); header.Titulo = "ACREDITACIONES"; header.SubTitulo = delegacion; header.LogoDerecha = Image.GetInstance(Path.Combine(HttpContext.Current.Server.MapPath("/"), @"images\marcaDoble.png")); header.LogoIzquierda = Image.GetInstance(Path.Combine(HttpContext.Current.Server.MapPath("/"), @"images\hammerLogoH.png")); writer.PageEvent = header; documentPdf.Open(); }
private static void SetHead(string categoria, string descEvento, string lugarEvento, int eventoid) { float legalMarginWidth = ItextUtils.CentimetersToPoints(33.02F); float legalMarginHeight = ItextUtils.CentimetersToPoints(21.59F); float marginLeft = ItextUtils.CentimetersToPoints(1); float marginRight = ItextUtils.CentimetersToPoints(1); float marginTop = ItextUtils.CentimetersToPoints(1); float marginBottom = ItextUtils.CentimetersToPoints(4); documentPdf = new Document(); documentPdf.SetPageSize(PageSize.LETTER); documentPdf.SetMargins(marginLeft, marginRight, marginTop, marginBottom); PdfWriter writer = PdfWriter.GetInstance(documentPdf, new FileStream(path, FileMode.Create)); HeaderGolf header = new HeaderGolf(); header.Titulo = lugarEvento; header.TituloIdioma = "Casa de campo COCHABAMBA"; header.SubTitulo = descEvento; header.Deporte = "golf"; header.HasLeyenda = true; header.Jornada = "todas"; header.Categoria = categoria; header.User = "";// user.Username; header.NombreReporte = "Resultados Finales."; header.LogoDerecha = Image.GetInstance(string.Format(@"{0}\Golf\{1}", pathImage, "golf.png")); header.LogoIzquierda = Image.GetInstance(string.Format(@"{0}\Golf\{1}", pathImage, "Federacion.png")); header.LogoAbajoDerecha = Image.GetInstance(string.Format(@"{0}\Hammer\{1}", pathImage, "marcaDoble.png")); header.LogoAbajoIzquierda = Image.GetInstance(string.Format(@"{0}\Hammer\{1}", pathImage, "hammerLogoH.png")); header.Fecha = GolfJornada.GetFechasJornadas(eventoid); PdfPTable leyen = new PdfPTable(new float[] { 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1 }); leyen.AddCell(DrawTable.DrawCell("Leyenda", 6, CellBorder.NONE, CellAlignment.Left, 14, CellFontStyle.Bold)); leyen.AddCell(DrawTable.DrawCellHeader("Hoyo en Uno", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE)); leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.YELLOW)); leyen.AddCell(DrawTable.DrawCellHeader("Albatros", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE)); leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, new BaseColor(192, 119, 160))); leyen.AddCell(DrawTable.DrawCellHeader("Eagle", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE)); leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, new BaseColor(248, 177, 17))); leyen.AddCell(DrawTable.DrawCellHeader("Birdie", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE)); leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, new BaseColor(35, 190, 82))); leyen.AddCell(DrawTable.DrawCellHeader("PAR", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE)); leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE)); leyen.AddCell(DrawTable.DrawCellHeader("Bogey", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE)); leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, new BaseColor(92, 119, 229))); leyen.AddCell(DrawTable.DrawCellHeader("Doble Bogey o más", 5, CellBorder.UNDEFINED, CellAlignment.Center, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE)); leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Buttom, CellFontStyle.Normal, new BaseColor(237, 62, 48))); header.leyendas = leyen; writer.PageEvent = header; documentPdf.Open(); }
private static void SetHead(string categoria, string descEvento, string lugarEvento, int eventoid) { float legalMarginWidth = ItextUtils.CentimetersToPoints(33.02F); float legalMarginHeight = ItextUtils.CentimetersToPoints(21.59F); float marginLeft = ItextUtils.CentimetersToPoints(1); float marginRight = ItextUtils.CentimetersToPoints(1); float marginTop = ItextUtils.CentimetersToPoints(1); float marginBottom = ItextUtils.CentimetersToPoints(4); documentPdf = new Document(); documentPdf.SetPageSize(PageSize.LETTER.Rotate()); documentPdf.SetMargins(marginLeft, marginRight, marginTop, marginBottom); PdfWriter writer = PdfWriter.GetInstance(documentPdf, new FileStream(path, FileMode.Create)); HeaderGolf header = new HeaderGolf(); header.Titulo = lugarEvento; header.TituloIdioma = "Casa de campo COCHABAMBA"; header.SubTitulo = descEvento; header.Deporte = "golf"; header.HasLeyenda = false; header.Jornada = "todas"; header.Categoria = categoria; header.User = "";// user.Username; header.NombreReporte = "Resultados Finales."; header.LogoDerecha = Image.GetInstance(string.Format(@"{0}\Golf\{1}", pathImage, "golf.png")); header.LogoIzquierda = Image.GetInstance(string.Format(@"{0}\Golf\{1}", pathImage, "Federacion.png")); header.LogoAbajoDerecha = Image.GetInstance(string.Format(@"{0}\Hammer\{1}", pathImage, "marcaDoble.png")); header.LogoAbajoIzquierda = Image.GetInstance(string.Format(@"{0}\Hammer\{1}", pathImage, "hammerLogoH.png")); header.Fecha = GolfJornada.GetFechasJornadas(eventoid); writer.PageEvent = header; documentPdf.Open(); }
private static void SetHead(string jornada, string categoria, string descEvento, string lugarEvento, int eventoId) { float legalMarginWidth = ItextUtils.CentimetersToPoints(33.02F); float legalMarginHeight = ItextUtils.CentimetersToPoints(21.59F); float marginLeft = ItextUtils.CentimetersToPoints(1); float marginRight = ItextUtils.CentimetersToPoints(1); float marginTop = ItextUtils.CentimetersToPoints(1); float marginBottom = ItextUtils.CentimetersToPoints(4); documentPdf = new Document(); documentPdf.SetPageSize(PageSize.LETTER.Rotate()); documentPdf.SetMargins(marginLeft, marginRight, marginTop, marginBottom); //Segir buscando como cambiarl la funte de las letras de todo el doc //documentPdf PdfWriter writer = PdfWriter.GetInstance(documentPdf, new FileStream(path, FileMode.Create)); HeaderGolf header = new HeaderGolf(); header.Titulo = lugarEvento; header.TituloIdioma = "Casa de Campo Cochabamba"; header.SubTitulo = descEvento; header.Deporte = "golf"; header.HasLeyenda = true; header.Jornada = jornada; header.Categoria = categoria; header.User = "******"; header.NombreReporte = "ListadoEquipos"; header.LogoDerecha = Image.GetInstance(string.Format(@"{0}\Golf\golf.png", pathImage)); header.LogoIzquierda = Image.GetInstance(string.Format(@"{0}\Golf\Federacion.png", pathImage)); header.LogoAbajoDerecha = Image.GetInstance(string.Format(@"{0}\Hammer\marcaDoble.png", pathImage)); header.LogoAbajoIzquierda = Image.GetInstance(string.Format(@"{0}\Hammer\hammerLogoH.png", pathImage)); string fechas = string.Empty; foreach (DateTime item in GolfJornada.GetGolfJornadasFechas(eventoId)) { if (string.IsNullOrEmpty(fechas)) { fechas = string.Format(DBGlobalization.GetCultureInfo(), "{0:dd}", item); } else { fechas = string.Format(DBGlobalization.GetCultureInfo(), "{0},{1:dd}", fechas, item); } } header.Fecha = fechas; PdfPTable leyen = new PdfPTable(new float[] { 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1 }); leyen.AddCell(DrawTable.DrawCell("Leyenda", 6, CellBorder.NONE, CellAlignment.Left, 14, CellFontStyle.Bold)); leyen.AddCell(DrawTable.DrawCellHeader("Hoyo en Uno", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE)); leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.YELLOW)); leyen.AddCell(DrawTable.DrawCellHeader("Albatros", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE)); leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, new BaseColor(192, 119, 160))); leyen.AddCell(DrawTable.DrawCellHeader("Eagle", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE)); leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, new BaseColor(248, 177, 17))); leyen.AddCell(DrawTable.DrawCellHeader("Birdie", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE)); leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, new BaseColor(35, 190, 82))); leyen.AddCell(DrawTable.DrawCellHeader("PAR", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE)); leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE)); leyen.AddCell(DrawTable.DrawCellHeader("Bogey", 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE)); leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.BOX, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Bold, new BaseColor(92, 119, 229))); leyen.AddCell(DrawTable.DrawCellHeader("Doble Bogey o más", 5, CellBorder.UNDEFINED, CellAlignment.Center, CellAlignment.Center, CellFontStyle.Bold, BaseColor.WHITE)); leyen.AddCell(DrawTable.DrawCellHeader(string.Empty, 5, CellBorder.UNDEFINED, CellAlignment.Right, CellAlignment.Buttom, CellFontStyle.Normal, new BaseColor(237, 62, 48))); header.leyendas = leyen; writer.PageEvent = header; documentPdf.Open(); }