public override void OnStartPage(PdfWriter writer, Document document) { if (DrawHeader) { base.OnStartPage(writer, document); PdfPTable header = new PdfPTable(new float[] { 1, 10, 1 }); header.WidthPercentage = 100; PdfPTable detalle = new PdfPTable(2); detalle.AddCell(DrawTable.DrawCellHeader("Nombre:", 8, CellBorder.NONE, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Normal)); detalle.AddCell(DrawTable.DrawCell(Nombre, 10, CellBorder.NONE, CellAlignment.Middle, CellFontStyle.Normal)); detalle.AddCell(DrawTable.DrawCellHeader("Unidad:", 8, CellBorder.NONE, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Normal)); detalle.AddCell(DrawTable.DrawCell(Unidad, 10, CellBorder.NONE, CellAlignment.Left, CellFontStyle.Normal)); detalle.AddCell(DrawTable.DrawCellHeader("Fecha:", 8, CellBorder.NONE, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Normal)); detalle.AddCell(DrawTable.DrawCell(Fecha, 10, CellBorder.NONE, CellAlignment.Left, CellFontStyle.Normal)); detalle.AddCell(DrawTable.DrawCellHeader("Semana:", 8, CellBorder.NONE, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Normal)); detalle.AddCell(DrawTable.DrawCell(Semana, 10, CellBorder.NONE, CellAlignment.Left, CellFontStyle.Normal)); detalle.AddCell(DrawTable.DrawCellHeader("Total Horas:", 8, CellBorder.NONE, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Normal)); detalle.AddCell(DrawTable.DrawCell(Totalhoras, 10, CellBorder.NONE, CellAlignment.Left, CellFontStyle.Normal)); PdfPCell cellImg; LogoIzquierda.ScaleToFit(60f, 60f); cellImg = new PdfPCell(LogoIzquierda); cellImg.Border = PdfPCell.NO_BORDER; header.AddCell(cellImg); PdfPCell tc = new PdfPCell(detalle); tc.Border = 0; header.AddCell(tc); LogoDerecha.ScaleToFit(60f, 60f); cellImg = new PdfPCell(LogoDerecha); cellImg.Border = PdfPCell.NO_BORDER; header.AddCell(cellImg); PdfPTable tp = new PdfPTable(new float[] { 60, 40 }); tp.AddCell(DrawTable.DrawCellHeader(Titulo, 14, CellBorder.NONE, CellAlignment.Right, CellAlignment.Middle, CellFontStyle.Bold)); tp.AddCell(DrawTable.DrawCellHeader(Formulario, 5, CellBorder.NONE, CellAlignment.Left, CellAlignment.Bottom, CellFontStyle.Bold)); document.Add(tp); document.Add(header); document.Add(DrawTable.Line()); document.Add(new Paragraph("\n")); } }
public override void OnStartPage(PdfWriter writer, Document document) { base.OnStartPage(writer, document); PdfPTable header = new PdfPTable(new float[] { 1, 10, 1 }); header.WidthPercentage = 100; PdfPTable detalle = new PdfPTable(2); detalle.AddCell(DrawTable.DrawCell(FirstCharToUpper(Titulo), 10, CellBorder.NONE, CellAlignment.Left, 0, CellFontStyle.Bold)); detalle.AddCell(DrawTable.DrawCell(FirstCharToUpper(Deporte), 12, CellBorder.NONE, CellAlignment.Right, 0, CellFontStyle.Bold)); detalle.AddCell(DrawTable.DrawCell(FirstCharToUpper(TituloIdioma), 7, CellBorder.NONE, CellAlignment.Left, 0, CellFontStyle.Normal)); detalle.AddCell(DrawTable.DrawCell("Categoria :", 6, CellBorder.NONE, CellAlignment.Right, 0, CellFontStyle.Normal)); detalle.AddCell(DrawTable.DrawCell(SubTitulo, 7, CellBorder.NONE, CellAlignment.Left, 0, CellFontStyle.Normal)); detalle.AddCell(DrawTable.DrawCell(FirstCharToUpper(Categoria), 8, CellBorder.NONE, CellAlignment.Right, 0, CellFontStyle.Bold)); detalle.AddCell(DrawTable.DrawCell("Jornada :", 6, CellBorder.NONE, CellAlignment.Right, 2, CellFontStyle.Normal)); detalle.AddCell(DrawTable.DrawCell(FirstCharToUpper(Jornada), 8, CellBorder.NONE, CellAlignment.Right, 2, CellFontStyle.Bold)); detalle.AddCell(DrawTable.DrawCell(Fecha, 6, CellBorder.NONE, CellAlignment.Left, 2, CellFontStyle.Normal)); LogoIzquierda.ScaleToFit(60f, 60f); LogoDerecha.ScaleToFit(60f, 60f); PdfPCell cellImg = new PdfPCell(LogoIzquierda); cellImg.Border = PdfPCell.NO_BORDER; header.AddCell(cellImg); PdfPCell tc = new PdfPCell(detalle); tc.Border = 0; tc.PaddingLeft = 10; tc.PaddingRight = 10; header.AddCell(tc); cellImg = new PdfPCell(LogoDerecha); cellImg.Border = PdfPCell.NO_BORDER; header.AddCell(cellImg); document.Add(header); document.Add(DrawTable.LineBottom(1, BaseColor.BLACK)); document.Add(new Paragraph("\n")); }
public override void OnStartPage(PdfWriter writer, Document document) { if (DrawHeader) { base.OnStartPage(writer, document); PdfPTable header = new PdfPTable(new float[] { 1, 10, 1 }); header.WidthPercentage = 100; PdfPTable detalle = new PdfPTable(2); detalle.AddCell(DrawTable.DrawCellHeader("Nombre:", 8, CellBorder.NONE, CellAlignment.Right, CellAlignment.Center, CellFontStyle.Normal)); detalle.AddCell(DrawTable.DrawCell(Nombre, 10, CellBorder.NONE, CellAlignment.Middle, CellFontStyle.Normal)); PdfPTable tp = new PdfPTable(new float[] { 70 }); tp.AddCell(DrawTable.DrawCellHeader(Titulo, 14, CellBorder.NONE, CellAlignment.Center, CellAlignment.Middle, CellFontStyle.Bold)); tp.AddCell(DrawTable.DrawCellHeader(Subtitulo1, 7, CellBorder.NONE, CellAlignment.Center, CellAlignment.Top, CellFontStyle.Normal)); tp.AddCell(DrawTable.DrawCellHeader(Subtitulo2, 9, CellBorder.NONE, CellAlignment.Center, CellAlignment.Top, CellFontStyle.Bold)); PdfPCell cellImg; LogoIzquierda.ScaleToFit(60f, 60f); cellImg = new PdfPCell(LogoIzquierda); cellImg.Border = PdfPCell.NO_BORDER; header.AddCell(cellImg); PdfPCell tc = new PdfPCell(tp); tc.Border = 0; header.AddCell(tc); LogoDerecha.ScaleToFit(60f, 60f); cellImg = new PdfPCell(LogoDerecha); cellImg.Border = PdfPCell.NO_BORDER; header.AddCell(cellImg); document.Add(header); document.Add(DrawTable.Line()); document.Add(new Paragraph("\n")); } }