private PdfPCell TableHeaderWithIcon(string data, string iconName, float w, float h, float t) { float[] widths = new float[] { 10f, 30f }; PdfPTable table = new PdfPTable(widths); Image icon = ImageReport.GetDemographicIcon(iconName); icon.ScaleToFit(w, h); PdfPCell cell1 = new PdfPCell(icon); cell1.HorizontalAlignment = Element.ALIGN_RIGHT; cell1.PaddingTop = t; cell1.PaddingRight = 2f; cell1.BorderWidth = 0; table.AddCell(cell1); PdfPCell cell = new PdfPCell(); Paragraph p = new Paragraph(13); Font lato = FontFactory.GetFont("Lato", 10f); lato.Color = new BaseColor(84, 84, 84); p.Add(new Chunk(data, lato)); cell.AddElement(p); cell.BorderWidth = 0; if (iconName == "Level") { cell.PaddingTop = -5f; } table.AddCell(cell); PdfPCell cellAll = new PdfPCell(table); cellAll.BorderWidth = 0; return(cellAll); }
private PdfPTable AddImage(string imageName) { PdfPTable resultTable = new PdfPTable(1); Image image = ImageReport.GetDemographicIcon("Sections/" + imageName); //image.ScaleToFit(37f, 37f); PdfPCell cell = new PdfPCell(image); cell.BorderWidth = 0; cell.HorizontalAlignment = Element.ALIGN_CENTER; resultTable.AddCell(cell); return(resultTable); }
private PdfPCell HeaderBlue(string data, string iconName, float w, float h, float t) { float[] widths = new float[] { 10f, 30f }; PdfPTable table = new PdfPTable(widths); Image icon = ImageReport.GetDemographicIcon(iconName); icon.ScaleToFit(w, h); PdfPCell cell1 = new PdfPCell(icon); cell1.HorizontalAlignment = Element.ALIGN_RIGHT; cell1.PaddingTop = t; cell1.PaddingRight = 2f; cell1.BorderWidth = 0; table.AddCell(cell1); PdfPCell cell = new PdfPCell(); Paragraph p = new Paragraph(); //p.Alignment = Element.ALIGN_CENTER; Font lato = new Font(Font.FontFamily.HELVETICA, 8f, Font.NORMAL, new BaseColor(255, 255, 255)); lato.Color = new BaseColor(255, 255, 255); p.Add(new Chunk(data, lato)); cell.AddElement(p); cell.BorderWidth = 0; cell.HorizontalAlignment = Element.ALIGN_CENTER; table.AddCell(cell); PdfPCell cellAll = new PdfPCell(table); cellAll.Padding = 10f; cellAll.BorderWidth = 0; cellAll.BackgroundColor = new BaseColor(10, 155, 255); cellAll.BorderColor = new BaseColor(10, 155, 255); return(cellAll); }
private PdfPCell TableContentName(string data, int number) { float[] widths = new float[] { 10f, 30f }; PdfPTable table = new PdfPTable(widths); // Imagen de perfil del candidato string urlImageCandidate = this.vacantCandidateReportComparative.candidate[number].candidate.AvatarUri; Image avatar; if (!string.IsNullOrWhiteSpace(urlImageCandidate)) { try { avatar = ImageReport.GetCandidateImage(urlImageCandidate); } catch { avatar = ImageReport.GetDemographicIcon("Avatar/User"); } } else { avatar = ImageReport.GetDemographicIcon("Avatar/User"); } avatar.ScaleToFit(37f, 37f); PdfPCell cell1 = new PdfPCell(avatar); cell1.VerticalAlignment = Element.ALIGN_MIDDLE; cell1.BorderWidth = 0; cell1.PaddingTop = 4F; cell1.PaddingBottom = 4F; table.AddCell(cell1); PdfPCell cell = new PdfPCell(); cell.PaddingLeft = 10f; cell.PaddingTop = 0.5f; Paragraph p = new Paragraph(); Font arial = FontFactory.GetFont("Arial", 12f); arial.Color = new BaseColor(0, 0, 0); p.Add(new Chunk(data, arial)); p.Alignment = Element.ALIGN_LEFT; cell.AddElement(p); Paragraph p2 = new Paragraph(13f); Font arialG = FontFactory.GetFont("Arial", 11f); arialG.Color = new BaseColor(10, 155, 255); int unicode = number + 65; char character = (char)unicode; p2.Add(new Chunk("Candidato " + character.ToString(), arialG)); cell.AddElement(p2); cell.BorderWidth = 0; table.AddCell(cell); PdfPCell cellAll = new PdfPCell(table); cellAll.BorderWidth = 0; return(cellAll); }