private iTextSharp.text.Table Obtener_Titulo(String pNro_Solicitud) { iTextSharp.text.Table tbTitulo = null; iTextSharp.text.Cell tdCell = null; iTextSharp.text.Chunk oChunk = null; // Tabla tbTitulo = new iTextSharp.text.Table(1); tbTitulo.Width = 90; tbTitulo.Cellpadding = 1; tbTitulo.Cellspacing = 0; tbTitulo.Border = iTextSharp.text.Rectangle.NO_BORDER; // Texto oChunk = new iTextSharp.text.Chunk("SOLICITUD DE ATENCIÓN MÚLTIPLE", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.HELVETICA, 12, iTextSharp.text.Font.BOLD, new iTextSharp.text.Color(0, 0, 0))); // Celda > Título tdCell = new iTextSharp.text.Cell(oChunk); tdCell.Header = false; tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_CENTER; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbTitulo.AddCell(tdCell); // Texto oChunk = new iTextSharp.text.Chunk(String.Format("Nro.: {0}", pNro_Solicitud), iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.HELVETICA, 12, iTextSharp.text.Font.BOLD, new iTextSharp.text.Color(0, 0, 0))); // Celda > Nro tdCell = new iTextSharp.text.Cell(oChunk); tdCell.Header = false; tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_CENTER; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbTitulo.AddCell(tdCell); // return(tbTitulo); }
private iTextSharp.text.Table Obtener_Pie(FirmaElectronicaModel oFirmaElectronicaModel) { String[] strArreglo = null; iTextSharp.text.Table tbPie = null; iTextSharp.text.Cell tdCell = null; iTextSharp.text.Chunk oChunk = null; // tbPie = new iTextSharp.text.Table(1); tbPie.Width = 90; tbPie.Cellpadding = 0; tbPie.Cellspacing = 0; tbPie.Border = iTextSharp.text.Rectangle.NO_BORDER; tbPie.BorderWidthTop = (float)1; // Footer oChunk = new iTextSharp.text.Chunk("Be careful! In Oracle, TIMESTAMP means a datatype, similar to but distinct from DATE. You'll avoid confusion if you don't use the word to mean anything else.", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Rectangle.ALIGN_JUSTIFIED; tdCell.VerticalAlignment = iTextSharp.text.Rectangle.ALIGN_BASELINE; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbPie.AddCell(tdCell); // return(tbPie); }
private iTextSharp.text.Table Obtener_Cuenta(FirmaElectronicaModel oFirmaElectronicaModel) { iTextSharp.text.Table tbCuenta = null; iTextSharp.text.Cell tdCell = null; iTextSharp.text.Chunk oChunk = null; // Tabla tbCuenta = new iTextSharp.text.Table(4); tbCuenta.Widths = new float[4] { 20, 25, 20, 25 }; tbCuenta.Width = 90; tbCuenta.Cellpadding = 1; tbCuenta.Cellspacing = 0; tbCuenta.Border = iTextSharp.text.Rectangle.NO_BORDER; // Sub-Título oChunk = new iTextSharp.text.Chunk(" Datos de la Cuenta", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.HELVETICA, 12, iTextSharp.text.Font.BOLD, new iTextSharp.text.Color(255, 255, 255))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.Header = true; tdCell.Colspan = 4; tdCell.HorizontalAlignment = iTextSharp.text.Rectangle.ALIGN_LEFT; tdCell.BackgroundColor = new iTextSharp.text.Color(66, 139, 202); tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbCuenta.AddCell(tdCell); tdCell = new iTextSharp.text.Cell(String.Empty); tdCell.Colspan = 4; tdCell.BackgroundColor = new iTextSharp.text.Color(66, 139, 202); tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbCuenta.AddCell(tdCell); // Producto y Cuenta oChunk = new iTextSharp.text.Chunk("Producto:", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_LEFT; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbCuenta.AddCell(tdCell); oChunk = new iTextSharp.text.Chunk("VISA", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_LEFT; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbCuenta.AddCell(tdCell); oChunk = new iTextSharp.text.Chunk("Nro. Cuenta:", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_LEFT; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbCuenta.AddCell(tdCell); oChunk = new iTextSharp.text.Chunk("544656157671165", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_LEFT; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbCuenta.AddCell(tdCell); // return(tbCuenta); }
private iTextSharp.text.Table Obtener_Logos(System.Web.UI.Page pPage) { iTextSharp.text.Table tbLogos = null; iTextSharp.text.Cell tdCell = null; iTextSharp.text.Image oFinancieraUno = null; iTextSharp.text.Image oOechsle = null; // Tabla tbLogos = new iTextSharp.text.Table(3); tbLogos.Width = 90; tbLogos.Cellpadding = 1; tbLogos.Cellspacing = 0; tbLogos.Border = iTextSharp.text.Rectangle.NO_BORDER; // if (pPage == null) { oFinancieraUno = iTextSharp.text.Image.GetInstance(string.Concat(System.Web.Hosting.HostingEnvironment.MapPath("~/Imagen/"), "Logo_ESSolutions.jpg")); } else { oFinancieraUno = iTextSharp.text.Image.GetInstance(string.Concat(pPage.Server.MapPath("~/Imagen/"), "Logo_ESSolutions.jpg")); } oFinancieraUno.ScaleAbsolute(300, 90); tdCell = new iTextSharp.text.Cell(); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_CENTER; tdCell.VerticalAlignment = iTextSharp.text.Element.ALIGN_MIDDLE; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tdCell.Add(oFinancieraUno); tbLogos.AddCell(tdCell); // tdCell = new iTextSharp.text.Cell(String.Empty); tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbLogos.AddCell(tdCell); // if (pPage == null) { oOechsle = iTextSharp.text.Image.GetInstance(string.Concat(System.Web.Hosting.HostingEnvironment.MapPath("~/Imagen/"), "Logo_ESSolutions.jpg")); } else { oOechsle = iTextSharp.text.Image.GetInstance(string.Concat(pPage.Server.MapPath("~/Imagen/"), "Logo_ESSolutions.jpg")); } oOechsle.ScaleAbsolute(65, 45); tdCell = new iTextSharp.text.Cell(); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_RIGHT; tdCell.VerticalAlignment = iTextSharp.text.Element.ALIGN_TOP; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tdCell.Add(oOechsle); tbLogos.AddCell(tdCell); // return(tbLogos); }
private iTextSharp.text.Table Obtener_Blanco() { iTextSharp.text.Table tbBlanco = null; iTextSharp.text.Cell tdCell = null; // tbBlanco = new iTextSharp.text.Table(1); tbBlanco.Width = 90; tbBlanco.Cellpadding = 3; tbBlanco.Cellspacing = 0; tbBlanco.Border = iTextSharp.text.Rectangle.NO_BORDER; tdCell = new iTextSharp.text.Cell(); tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tdCell.BorderColor = iTextSharp.text.Color.BLACK; tbBlanco.AddCell(tdCell); // return(tbBlanco); }
public IActionResult OnPost(int id) { FileStreamResult rr; //using () { var stream = new MemoryStream(); iTextSharp.text.Document doc = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 30f, 30f, 30f, 30f); iTextSharp.text.pdf.PdfWriter ww = iTextSharp.text.pdf.PdfWriter.GetInstance(doc, stream); doc.Open(); doc.Add(new iTextSharp.text.Chunk("john vitor meu amigo")); doc.Add(new iTextSharp.text.Chunk("")); iTextSharp.text.Table tb = new iTextSharp.text.Table(3); tb.AddCell(new iTextSharp.text.Cell("asdf")); tb.AddCell(new iTextSharp.text.Cell("asdf")); tb.AddCell(new iTextSharp.text.Cell("asdf")); tb.AddCell(new iTextSharp.text.Cell("asdf")); tb.AddCell(new iTextSharp.text.Cell("asdf")); tb.AddCell(new iTextSharp.text.Cell("asdf")); doc.Add(tb); doc.Close(); return(File(stream.ToArray(), "application/pdf")); } }
private iTextSharp.text.Table Obtener_Firma() { iTextSharp.text.Table tbFirma = null; iTextSharp.text.Cell tdCell = null; iTextSharp.text.Chunk oChunk = null; // Tabla tbFirma = new iTextSharp.text.Table(3); tbFirma.Widths = new float[3] { 25, 30, 25 }; tbFirma.Width = 80;; tbFirma.Cellpadding = 1; tbFirma.Cellspacing = 0; tbFirma.Alignment = iTextSharp.text.Element.ALIGN_CENTER; tbFirma.Border = 1; tbFirma.BorderWidth = (float)1; tbFirma.BorderWidthBottom = (float)1; tbFirma.BorderWidthLeft = (float)1; tbFirma.BorderWidthRight = (float)1; // oChunk = new iTextSharp.text.Chunk("A", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.HELVETICA, 10, iTextSharp.text.Color.WHITE)); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbFirma.AddCell(tdCell); tdCell = new iTextSharp.text.Cell(String.Empty); tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tdCell.BorderWidthLeft = (float)1; tdCell.BorderWidthRight = (float)1; tbFirma.AddCell(tdCell); tdCell = new iTextSharp.text.Cell(String.Empty); tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbFirma.AddCell(tdCell); oChunk = new iTextSharp.text.Chunk("B", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.HELVETICA, 10, iTextSharp.text.Color.WHITE)); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbFirma.AddCell(tdCell); tdCell = new iTextSharp.text.Cell(String.Empty); tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tdCell.BorderWidthLeft = (float)1; tdCell.BorderWidthRight = (float)1; tbFirma.AddCell(tdCell); tdCell = new iTextSharp.text.Cell(String.Empty); tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbFirma.AddCell(tdCell); oChunk = new iTextSharp.text.Chunk("V°B° Autorizador", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.BOLD, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_CENTER; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbFirma.AddCell(tdCell); oChunk = new iTextSharp.text.Chunk("Firma y sello del Asesor de Servicio", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.BOLD, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_CENTER; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tdCell.BorderWidthLeft = (float)1; tdCell.BorderWidthRight = (float)1; tbFirma.AddCell(tdCell); oChunk = new iTextSharp.text.Chunk("Firma del cliente", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.BOLD, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_CENTER; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbFirma.AddCell(tdCell); tdCell = new iTextSharp.text.Cell(String.Empty); tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbFirma.AddCell(tdCell); tdCell = new iTextSharp.text.Cell(String.Empty); tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tdCell.BorderWidthLeft = (float)1; tdCell.BorderWidthRight = (float)1; tbFirma.AddCell(tdCell); tdCell = new iTextSharp.text.Cell(String.Empty); tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbFirma.AddCell(tdCell); // return(tbFirma); }
private iTextSharp.text.Table Obtener_Solicitud(FirmaElectronicaModel oFirmaElectronicaModel, String pUsuario) { Boolean boFlag_Titular = false, boFlag_Adicional = false; iTextSharp.text.Table tbSolicitud = null; iTextSharp.text.Cell tdCell = null; iTextSharp.text.Chunk oChunk = null; // Tabla tbSolicitud = new iTextSharp.text.Table(4); tbSolicitud.Widths = new float[4] { 20, 25, 20, 25 }; tbSolicitud.Width = 90; tbSolicitud.Cellpadding = 1; tbSolicitud.Cellspacing = 0; tbSolicitud.Border = iTextSharp.text.Rectangle.NO_BORDER; #region "Solicitud > Superior" // Sub-Título oChunk = new iTextSharp.text.Chunk(" Datos de la Solicitud", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.HELVETICA, 12, iTextSharp.text.Font.BOLD, new iTextSharp.text.Color(255, 255, 255))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.Header = true; tdCell.Colspan = 4; tdCell.HorizontalAlignment = iTextSharp.text.Rectangle.ALIGN_LEFT; tdCell.BackgroundColor = new iTextSharp.text.Color(66, 139, 202); tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbSolicitud.AddCell(tdCell); tdCell = new iTextSharp.text.Cell(String.Empty); tdCell.Colspan = 4; tdCell.BackgroundColor = new iTextSharp.text.Color(66, 139, 202); tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbSolicitud.AddCell(tdCell); // Fecha y Agencia oChunk = new iTextSharp.text.Chunk("Fecha de Solicitud:", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_LEFT; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbSolicitud.AddCell(tdCell); oChunk = new iTextSharp.text.Chunk(DateTime.Now.ToShortDateString(), iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_LEFT; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbSolicitud.AddCell(tdCell); oChunk = new iTextSharp.text.Chunk("Agencia:", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_LEFT; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbSolicitud.AddCell(tdCell); oChunk = new iTextSharp.text.Chunk("Principal", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_LEFT; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbSolicitud.AddCell(tdCell); // Tipo de Requerimiento oChunk = new iTextSharp.text.Chunk("Tipo de atención:", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_LEFT; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbSolicitud.AddCell(tdCell); oChunk = new iTextSharp.text.Chunk("Contratos", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.BOLD, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.Colspan = 3; tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_LEFT; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbSolicitud.AddCell(tdCell); #endregion return(tbSolicitud); }
private iTextSharp.text.Table Obtener_Cliente(FirmaElectronicaModel oFirmaElectronicaModel) { iTextSharp.text.Table tbCliente = null; iTextSharp.text.Cell tdCell = null; iTextSharp.text.Chunk oChunk = null; // Tabla tbCliente = new iTextSharp.text.Table(4, 4); tbCliente.Widths = new float[4] { 20, 25, 20, 25 }; tbCliente.Width = 90; tbCliente.Cellpadding = 1; tbCliente.Cellspacing = 0; tbCliente.Border = iTextSharp.text.Rectangle.NO_BORDER; // Sub-Título oChunk = new iTextSharp.text.Chunk(" Datos del Cliente", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.HELVETICA, 12, iTextSharp.text.Font.BOLD, new iTextSharp.text.Color(255, 255, 255))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.Header = true; tdCell.Colspan = 4; tdCell.HorizontalAlignment = iTextSharp.text.Rectangle.ALIGN_LEFT; tdCell.BackgroundColor = new iTextSharp.text.Color(66, 139, 202); tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbCliente.AddCell(tdCell); tdCell = new iTextSharp.text.Cell(String.Empty); tdCell.Colspan = 4; tdCell.BackgroundColor = new iTextSharp.text.Color(66, 139, 202); tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbCliente.AddCell(tdCell); // Documento : Tipo y Nro. oChunk = new iTextSharp.text.Chunk("Tipo Documento:", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_LEFT; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbCliente.AddCell(tdCell); oChunk = new iTextSharp.text.Chunk("DNI", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_LEFT; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbCliente.AddCell(tdCell); oChunk = new iTextSharp.text.Chunk("Nro. Documento:", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_LEFT; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbCliente.AddCell(tdCell); oChunk = new iTextSharp.text.Chunk(oFirmaElectronicaModel.oPersona.DNI, iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_LEFT; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbCliente.AddCell(tdCell); // Nombres y Apellidos oChunk = new iTextSharp.text.Chunk("Nombres:", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_LEFT; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbCliente.AddCell(tdCell); oChunk = new iTextSharp.text.Chunk(String.Format("{0} {1}", oFirmaElectronicaModel.oPersona.PRI_NOMBRE.ToUpper(), (String.IsNullOrEmpty(oFirmaElectronicaModel.oPersona.SEG_NOMBRE) ? String.Empty : oFirmaElectronicaModel.oPersona.SEG_NOMBRE).ToUpper()), iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_LEFT; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbCliente.AddCell(tdCell); oChunk = new iTextSharp.text.Chunk("Apellidos:", iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_LEFT; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbCliente.AddCell(tdCell); oChunk = new iTextSharp.text.Chunk(String.Format("{0} {1}", oFirmaElectronicaModel.oPersona.APE_PATERNO.ToUpper(), (String.IsNullOrEmpty(oFirmaElectronicaModel.oPersona.APE_MATERNO) ? String.Empty : oFirmaElectronicaModel.oPersona.APE_MATERNO).ToUpper()), iTextSharp.text.FontFactory.GetFont(iTextSharp.text.FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(0, 0, 0))); tdCell = new iTextSharp.text.Cell(oChunk); tdCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_LEFT; tdCell.Border = iTextSharp.text.Rectangle.NO_BORDER; tbCliente.AddCell(tdCell); // return(tbCliente); }
/// <summary> /// a megadott file elérési úttal elkészíti a pdf dokumentumot /// </summary> /// <param name="financedAmount"></param> /// <param name="calcValues"></param> /// <param name="pdfFileWithPath"></param> /// <returns></returns> public void CreateLeasingDocument(string financedAmount, System.Collections.Specialized.StringCollection calcValues, string pdfFileWithPath) { iTextSharp.text.Document document = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 36, 36, 36, 36); //marginTop : 72 try { // writer letrehozas iTextSharp.text.pdf.PdfWriter.GetInstance(document, new System.IO.FileStream(pdfFileWithPath, System.IO.FileMode.Create)); // lablec iTextSharp.text.HeaderFooter footer = new iTextSharp.text.HeaderFooter(new iTextSharp.text.Phrase(), true); footer.Border = iTextSharp.text.Rectangle.NO_BORDER; footer.Alignment = iTextSharp.text.HeaderFooter.ALIGN_CENTER; document.Footer = footer; // dokumentum megnyitas document.Open(); iTextSharp.text.Chapter chapter1 = new iTextSharp.text.Chapter(2); chapter1.NumberDepth = 0; //fejlec kep iTextSharp.text.Image imgHeader = GetHeaderImageFile(); imgHeader.Alignment = iTextSharp.text.Image.ALIGN_LEFT; imgHeader.Alt = "NE VEDD MEG, BÉRELD!"; iTextSharp.text.Table hTable = new iTextSharp.text.Table(1, 1); iTextSharp.text.Cell hCell = new iTextSharp.text.Cell(imgHeader); hTable.AutoFillEmptyCells = true; hTable.TableFitsPage = true; hTable.WidthPercentage = 100; hTable.AddCell(hCell); hTable.Alignment = iTextSharp.text.Table.ALIGN_LEFT; chapter1.Add(hTable); iTextSharp.text.Color defaultTextColor = new iTextSharp.text.Color(0, 0, 128); //uj sor, tavtarto a tabla es a fejleckep kozott chapter1.Add(new iTextSharp.text.Paragraph(" ")); iTextSharp.text.pdf.BaseFont default_ttf = iTextSharp.text.pdf.BaseFont.CreateFont(CompanyGroup.Helpers.ConfigSettingsParser.GetString("FontFile", "c:\\Windows\\Fonts\\calibri.ttf"), iTextSharp.text.pdf.BaseFont.IDENTITY_H, iTextSharp.text.pdf.BaseFont.EMBEDDED); iTextSharp.text.Font titlefont = new iTextSharp.text.Font(default_ttf, 16, iTextSharp.text.Font.BOLDITALIC, defaultTextColor); iTextSharp.text.Font defaultFont = new iTextSharp.text.Font(default_ttf, 15, iTextSharp.text.Font.NORMAL, defaultTextColor); //cimsor iTextSharp.text.Paragraph pgTitle = new iTextSharp.text.Paragraph("Finanszírozási ajánlat", titlefont); chapter1.Add(pgTitle); //tablazat iTextSharp.text.Table table1 = new iTextSharp.text.Table(2, 1); table1.BorderColor = table1.DefaultCellBorderColor = defaultTextColor; table1.Padding = 2; table1.Spacing = 1; table1.AutoFillEmptyCells = true; table1.Alignment = iTextSharp.text.Table.ALIGN_LEFT; table1.WidthPercentage = 80.0f; table1.Widths = new float[] { 60, 20 }; iTextSharp.text.Paragraph tmpParagraph = new iTextSharp.text.Paragraph("A konfiguráció nettó vételára:", defaultFont); iTextSharp.text.Cell cell1 = new iTextSharp.text.Cell(tmpParagraph); cell1.HorizontalAlignment = iTextSharp.text.Element.ALIGN_CENTER; cell1.VerticalAlignment = iTextSharp.text.Element.ALIGN_MIDDLE; table1.AddCell(cell1); tmpParagraph = new iTextSharp.text.Paragraph(financedAmount + " Ft", defaultFont); iTextSharp.text.Cell cell2 = new iTextSharp.text.Cell(tmpParagraph); cell2.HorizontalAlignment = iTextSharp.text.Element.ALIGN_RIGHT; cell2.VerticalAlignment = iTextSharp.text.Element.ALIGN_MIDDLE; table1.AddCell(cell2); chapter1.Add(table1); //5 oszlopos tabla iTextSharp.text.Table table2 = new iTextSharp.text.Table(5); table2.BorderColor = defaultTextColor; table2.Padding = 2; table2.Spacing = 1; table2.AutoFillEmptyCells = true; table2.Alignment = iTextSharp.text.Table.ALIGN_LEFT; table2.WidthPercentage = 100.0f; table2.Widths = new float[] { 20, 20, 20, 20, 20 }; //első sor tmpParagraph = new iTextSharp.text.Paragraph("Önerő", defaultFont); cell1 = new iTextSharp.text.Cell(tmpParagraph); cell1.HorizontalAlignment = iTextSharp.text.Element.ALIGN_CENTER; cell1.VerticalAlignment = iTextSharp.text.Element.ALIGN_MIDDLE; cell1.Header = true; cell1.Colspan = 4; cell1.BorderColor = defaultTextColor; table2.AddCell(cell1); tmpParagraph = new iTextSharp.text.Paragraph("0 Ft", defaultFont); cell2 = new iTextSharp.text.Cell(tmpParagraph); cell2.HorizontalAlignment = iTextSharp.text.Element.ALIGN_RIGHT; cell2.VerticalAlignment = iTextSharp.text.Element.ALIGN_MIDDLE; cell2.BorderColor = defaultTextColor; table2.AddCell(cell2); //második sor //table2.AddCell(""); tmpParagraph = new iTextSharp.text.Paragraph("Deviza: HUF", defaultFont); iTextSharp.text.Cell tmpCell = new iTextSharp.text.Cell(tmpParagraph); tmpCell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_RIGHT; tmpCell.VerticalAlignment = iTextSharp.text.Element.ALIGN_MIDDLE; tmpCell.BorderColor = defaultTextColor; tmpCell.Rowspan = 2; table2.AddCell(tmpCell); tmpParagraph = new iTextSharp.text.Paragraph("Futamidő hónapokban", defaultFont); cell1 = new iTextSharp.text.Cell(tmpParagraph); cell1.HorizontalAlignment = iTextSharp.text.Element.ALIGN_CENTER; cell1.VerticalAlignment = iTextSharp.text.Element.ALIGN_MIDDLE; cell1.BorderColor = defaultTextColor; cell1.Colspan = 4; table2.AddCell(cell1); //harmadik sor tmpParagraph = new iTextSharp.text.Paragraph("24", defaultFont); cell2 = new iTextSharp.text.Cell(tmpParagraph); cell2.HorizontalAlignment = iTextSharp.text.Element.ALIGN_RIGHT; cell2.VerticalAlignment = iTextSharp.text.Element.ALIGN_MIDDLE; cell2.BorderColor = defaultTextColor; table2.AddCell(cell2); tmpParagraph = new iTextSharp.text.Paragraph("36", defaultFont); iTextSharp.text.Cell cell3 = new iTextSharp.text.Cell(tmpParagraph); cell3.HorizontalAlignment = iTextSharp.text.Element.ALIGN_RIGHT; cell3.VerticalAlignment = iTextSharp.text.Element.ALIGN_MIDDLE; cell3.BorderColor = defaultTextColor; table2.AddCell(cell3); tmpParagraph = new iTextSharp.text.Paragraph("48", defaultFont); iTextSharp.text.Cell cell4 = new iTextSharp.text.Cell(tmpParagraph); cell4.HorizontalAlignment = iTextSharp.text.Element.ALIGN_RIGHT; cell4.VerticalAlignment = iTextSharp.text.Element.ALIGN_MIDDLE; cell4.BorderColor = defaultTextColor; table2.AddCell(cell4); tmpParagraph = new iTextSharp.text.Paragraph("60", defaultFont); iTextSharp.text.Cell cell5 = new iTextSharp.text.Cell(tmpParagraph); cell5.HorizontalAlignment = iTextSharp.text.Element.ALIGN_RIGHT; cell5.VerticalAlignment = iTextSharp.text.Element.ALIGN_MIDDLE; cell5.BorderColor = defaultTextColor; table2.AddCell(cell5); //negyedik sor tmpParagraph = new iTextSharp.text.Paragraph("Tartós bérlet", defaultFont); cell1 = new iTextSharp.text.Cell(tmpParagraph); cell1.HorizontalAlignment = iTextSharp.text.Element.ALIGN_RIGHT; cell1.VerticalAlignment = iTextSharp.text.Element.ALIGN_MIDDLE; cell1.BorderColor = defaultTextColor; table2.AddCell(cell1); tmpParagraph = new iTextSharp.text.Paragraph(GetItemByPositionFromStringCollection(0, calcValues), defaultFont); cell2 = new iTextSharp.text.Cell(tmpParagraph); cell2.HorizontalAlignment = iTextSharp.text.Element.ALIGN_RIGHT; cell2.VerticalAlignment = iTextSharp.text.Element.ALIGN_MIDDLE; cell2.BorderColor = defaultTextColor; table2.AddCell(cell2); tmpParagraph = new iTextSharp.text.Paragraph(GetItemByPositionFromStringCollection(1, calcValues), defaultFont); cell3 = new iTextSharp.text.Cell(tmpParagraph); cell3.HorizontalAlignment = iTextSharp.text.Element.ALIGN_RIGHT; cell3.VerticalAlignment = iTextSharp.text.Element.ALIGN_MIDDLE; cell3.BorderColor = defaultTextColor; table2.AddCell(cell3); tmpParagraph = new iTextSharp.text.Paragraph(GetItemByPositionFromStringCollection(2, calcValues), defaultFont); cell4 = new iTextSharp.text.Cell(tmpParagraph); cell4.HorizontalAlignment = iTextSharp.text.Element.ALIGN_RIGHT; cell4.VerticalAlignment = iTextSharp.text.Element.ALIGN_MIDDLE; cell4.BorderColor = defaultTextColor; table2.AddCell(cell4); tmpParagraph = new iTextSharp.text.Paragraph(GetItemByPositionFromStringCollection(3, calcValues), defaultFont); cell5 = new iTextSharp.text.Cell(tmpParagraph); cell5.HorizontalAlignment = iTextSharp.text.Element.ALIGN_RIGHT; cell5.VerticalAlignment = iTextSharp.text.Element.ALIGN_MIDDLE; cell5.BorderColor = defaultTextColor; table2.AddCell(cell5); //ötödik sor table2.AddCell(""); tmpParagraph = new iTextSharp.text.Paragraph("Nettó havidíjak", defaultFont); cell1 = new iTextSharp.text.Cell(tmpParagraph); cell1.HorizontalAlignment = iTextSharp.text.Element.ALIGN_CENTER; cell1.VerticalAlignment = iTextSharp.text.Element.ALIGN_MIDDLE; cell1.BorderColor = defaultTextColor; cell1.Colspan = 4; table2.AddCell(cell1); //hatodik sor //tmpParagraph = new iTextSharp.text.Paragraph( "A kalkulált díjak biztosítási díjat is tartalmaznak.", defaultFont ); //cell1 = new iTextSharp.text.Cell( tmpParagraph ); //cell1.HorizontalAlignment = iTextSharp.text.Element.ALIGN_CENTER; //cell1.VerticalAlignment = iTextSharp.text.Element.ALIGN_MIDDLE; //cell1.BorderColor = defaultTextColor; //cell1.Colspan = 5; //table2.AddCell(cell1); chapter1.Add(table2); chapter1.Add(new iTextSharp.text.Paragraph(" ")); //szoveg iTextSharp.text.Font smallFont = new iTextSharp.text.Font(default_ttf, 9, iTextSharp.text.Font.ITALIC, defaultTextColor); iTextSharp.text.Paragraph sText = new iTextSharp.text.Paragraph("HUF alapú finanszírozás, a havi díj az 1 havi Buborhoz kötött", smallFont); chapter1.Add(sText); //uj sor chapter1.Add(new iTextSharp.text.Paragraph(" ")); //szoveg iTextSharp.text.Font bold_10_Font = new iTextSharp.text.Font(default_ttf, 10, iTextSharp.text.Font.BOLD, defaultTextColor); sText = new iTextSharp.text.Paragraph("Ajánlatunkat ajánlati kötöttség nélkül tettük meg!", bold_10_Font); chapter1.Add(sText); //szoveg sText = new iTextSharp.text.Paragraph("Az ügylet megkötéséhez a refinanszírozó jóváhagyása szükséges.", bold_10_Font); chapter1.Add(sText); //uj sor chapter1.Add(new iTextSharp.text.Paragraph(" ")); ////szoveg //var bold_12_Font = new iTextSharp.text.Font( default_ttf, 12, iTextSharp.text.Font.BOLD, defaultTextColor ); //sText = new iTextSharp.text.Paragraph( "Szerződéskötési díj: 0 Ft", bold_12_Font ); //chapter1.Add(sText); ////uj sor //chapter1.Add(new iTextSharp.text.Paragraph(" ")); //szoveg sText = new iTextSharp.text.Paragraph("A tartós bérlet alapvető jellemzői", bold_10_Font); chapter1.Add(sText); //szoveg iTextSharp.text.Font normal_10_Font = new iTextSharp.text.Font(default_ttf, 10, iTextSharp.text.Font.NORMAL, defaultTextColor); sText = new iTextSharp.text.Paragraph("A bérleti díjakat ÁFA terheli, mely visszaigényelhető", normal_10_Font); sText.IndentationLeft = 50; chapter1.Add(sText); //szoveg sText = new iTextSharp.text.Paragraph("Az eszköz a bérbeadó könyveiben kerül aktiválásra", normal_10_Font); sText.IndentationLeft = 50; chapter1.Add(sText); //szoveg sText = new iTextSharp.text.Paragraph("A havi díj költségként elszámolható, csökkentve ezáltal az adóalapot", normal_10_Font); sText.IndentationLeft = 50; chapter1.Add(sText); //uj sor chapter1.Add(new iTextSharp.text.Paragraph(" ")); //szoveg sText = new iTextSharp.text.Paragraph("Ha bármilyen kérdése merülne fel a konstrukciót illetően, forduljon hozzánk bizalommal!", bold_10_Font); chapter1.Add(sText); //uj sor chapter1.Add(new iTextSharp.text.Paragraph(" ")); //szoveg sText = new iTextSharp.text.Paragraph("Kublik Ádám", bold_10_Font); chapter1.Add(sText); //szoveg sText = new iTextSharp.text.Paragraph("értékesítési vezető", normal_10_Font); chapter1.Add(sText); //szoveg sText = new iTextSharp.text.Paragraph("HRP Finance", bold_10_Font); chapter1.Add(sText); //szoveg sText = new iTextSharp.text.Paragraph("Tel.: +36 1 452 46 16", normal_10_Font); chapter1.Add(sText); //szoveg sText = new iTextSharp.text.Paragraph("mob.: +36 70 452 46 16", normal_10_Font); chapter1.Add(sText); //szoveg sText = new iTextSharp.text.Paragraph("mail: [email protected]", normal_10_Font); chapter1.Add(sText); document.Add(chapter1); } catch (iTextSharp.text.DocumentException documentException) { throw documentException; } catch (System.IO.IOException ioeException) { throw ioeException; } finally { // dokumentum bezarasa document.Close(); } }