using iTextSharp.text; using iTextSharp.text.pdf; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Data.SQLite; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Windows.Forms; using static System.Windows.Forms.VisualStyles.VisualStyleElement; using Image = iTextSharp.text.Image; using TextBox = System.Windows.Forms.TextBox; namespace CKUERA { public partial class Pagare : Form { public Pagare() { InitializeComponent(); } private void Pagare_Load(object sender, EventArgs e) { this.Width = 0;//ANCHO INICIAL PARA DESPERTAR EL RESIZE panel1.Width = 633; panel1.Height = 336; panel1.Top = button2.Top + button2.Height+7; panel1.Left = button2.Left; Simbolo.Items.Clear(); Simbolo.Items.Add("Gs. "); Simbolo.Items.Add("U$D. "); Simbolo.Items.Add("$. "); Simbolo.Text=Global.SIMB_; button3.Left = 3000; //using (MySqlConnection Conex = new MySqlConnection(string.Format("Server={0};Database={1};Uid={2};Pwd={3};Port={4};", Global._host, Global._base, Global._usuario, Global._pass, Global._port))) { //Conex.Open(); SQLiteDataReader RS = null;//SELECCIONA LOS DATOS SI YA EXISTE string SQL = "SELECT * FROM PAGARE_CONFIG;"; SQLiteCommand CMD3 = new SQLiteCommand(SQL, Global.conexion); RS = CMD3.ExecuteReader(); if (RS.HasRows == true)//LEE LOS DATOS SI YA EXISTE { RS.Read(); Titular.Text = RS.GetString(1); CI_titu.Text = RS.GetString(2); Ciudad_Titu.Text = RS.GetString(3); Text1.Text = RS.GetString(4); Global.AquienP = RS.GetString(1); Global.CI_AquienP = RS.GetString(2); Global.CiudadP = RS.GetString(3); Global.Text_Pagare = RS.GetString(4); } else//SI NO EXISTE INSERTA UNA FILA { RS.Close(); string SQLin = "INSERT INTO PAGARE_CONFIG (TITULAR,CI_TITU,CIUDAD,TEXTO1) VALUES('NOMBRE DEL TITULAR','000000','LA CIUDAD','Queda expresamente convenido que la falta del pago de éste pagaré a su vencimiento, producirá la mora automática facultando al (los) acreedor (es), irrevocablemente a exigir el pago inmediato del total de la deuda (Art.424 C.C.). La mora se producirá por el mero vencimiento del plazo, sin necesidad de protesto ni de ningún requerimiento por parte del (los) acreedores. En caso de mora, las cantidades adeudadas devengarán automáticamente un interés moratorio del 2% y un interés punitorio del ____%, desde el día de la mora hasta el día del efectivo pago total de la deuda, sin que ello implique novación, prorroga o espera. Este documento autoriza irrevocablemente al (los) acreedor (es), otorgando suficiente mandato en los términos del Art. 917 del Código Civil, para que por cuenta propia o a través de empresas especializadas de nuestro medio (INFORMCONF) pueda recabar información de los registros públicos y/o privados referentes a la situación patrimonial, solvencia económica o el cumplimiento de las obligaciones del (los) deudor (es). Acepto expresamente que la mora se producirá por el mero vencimiento del plazo, sin necesidad de protesto ni de ningún requerimiento judicial ni extra judicial por parte del acreedor y autorizo la inclusión de mi nombre personal o razón social que represento a la base de datos de informaciones comerciales, conforme a lo establecido en la Ley 1682/01, y su modificatoria Ley Nº 1969/02; como también para que se pueda proveer la información a terceros interesados. - A todos los efectos jurídicos, acepto la jurisdicción de los tribunales de la capital del país. Por lo que el DEUDOR autoriza por este medio, que se lo incluya en nómina de morosos de estas entidades. Se conviene, además, que, se fija domicilio especial en el /los lugar (es) señalado (s) más abajo, donde tendrán validez y como hechas personalmente todas las notificaciones practicadas en el(los) mismo (s), aun cuando fuesen hechas por telegrama colacionado. A todos los efectos legales declaran la prórroga de cualquier jurisdicción que les pudiere corresponder y se someten expresamente a la jurisdicción y competencia de los tribunales ordinarios el Paraguay.- ');"; SQLiteCommand CMD = new SQLiteCommand(SQLin, Global.conexion); CMD.ExecuteNonQuery(); SQLiteDataReader RS2 = null;//SELECCIONA LO INSERTADO string SQL2 = "SELECT * FROM PAGARE_CONFIG;"; SQLiteCommand CMD2 = new SQLiteCommand(SQL2, Global.conexion); RS2 = CMD2.ExecuteReader(); RS2.Read();//MUESTRA LOS DATOS INSERTADOS Titular.Text = RS2.GetString(1); CI_titu.Text = RS2.GetString(2); Ciudad_Titu.Text = RS2.GetString(3); Text1.Text = RS2.GetString(4); try { Global.AquienP = RS.GetString(1); Global.CI_AquienP = RS.GetString(2); Global.CiudadP = RS.GetString(3); Global.Text_Pagare = RS.GetString(4); RS2.Close(); } catch (Exception) { } } RS.Close(); //Conex.Close(); } { string name = "iconos\\procesar.png"; try { Button1.Image = System.Drawing.Image.FromFile(name); } catch (Exception) { } } } private void Pagare_Resize(object sender, EventArgs e) { this.BackColor = Global.ColorSistema; Button1.BackColor = this.BackColor = Global.ColorSistema;// panel2.Left = this.Width / 2 - panel2.Width / 2; panel2.Top = this.Height / 2 - panel2.Height / 2; Btn_Cerrar.Top = 0; Btn_Cerrar.Left = panel2.Width - Btn_Cerrar.Width; Lb_Titulo.Top = 0; Lb_Titulo.Left = 0; Lb_Titulo.Text = this.Text; } //BOTÓN PROCESAR private void Button1_Click(object sender, EventArgs e) { if (Deudor.Text == "") { Deudor.Select(); return; } Deudor.Text = Deudor.Text.Replace("&", "y"); Deudor.Text = Deudor.Text.Replace("'", "`"); Deudor.Text = Deudor.Text.Replace(";", ","); Deudor.Text = Deudor.Text.Replace("\\", ","); if (Regex.IsMatch(Deudor.Text, "[^a-zA-Z0-9-/_() .,áéíóúÁÉÍÓÚñÑ`]")) { MessageBox.Show("En el campo escrito existe caracter especial no admitido. Reemplace y vuelva a presionar ENTER.", "ATENCIÓN", MessageBoxButtons.OK, MessageBoxIcon.Information); Deudor.Select(); return; } if (CI_deudor.Text == "") { CI_deudor.Select(); return; } CI_deudor.Text = CI_deudor.Text.Replace("&", "y"); CI_deudor.Text = CI_deudor.Text.Replace("'", "`"); CI_deudor.Text = CI_deudor.Text.Replace(";", ","); CI_deudor.Text = CI_deudor.Text.Replace("\\", ","); if (Regex.IsMatch(CI_deudor.Text, "[^a-zA-Z0-9-/_() .,áéíóúÁÉÍÓÚñÑ`]")) { MessageBox.Show("En el campo escrito existe caracter especial no admitido. Reemplace y vuelva a presionar ENTER.", "ATENCIÓN", MessageBoxButtons.OK, MessageBoxIcon.Information); CI_deudor.Select(); return; } if (Dom_Deudor.Text == "") { Dom_Deudor.Select(); return; } Dom_Deudor.Text = Dom_Deudor.Text.Replace("&", "y"); Dom_Deudor.Text = Dom_Deudor.Text.Replace("'", "`"); Dom_Deudor.Text = Dom_Deudor.Text.Replace(";", ","); Dom_Deudor.Text = Dom_Deudor.Text.Replace("\\", ","); if (Regex.IsMatch(Dom_Deudor.Text, "[^a-zA-Z0-9-/_() .,áéíóúÁÉÍÓÚñÑ`]")) { MessageBox.Show("En el campo escrito existe caracter especial no admitido. Reemplace y vuelva a presionar ENTER.", "ATENCIÓN", MessageBoxButtons.OK, MessageBoxIcon.Information); Dom_Deudor.Select(); return; } if (Cel_Deudor.Text == "") { Cel_Deudor.Select(); return; } Cel_Deudor.Text = Cel_Deudor.Text.Replace("&", "y"); Cel_Deudor.Text = Cel_Deudor.Text.Replace("'", "`"); Cel_Deudor.Text = Cel_Deudor.Text.Replace(";", ","); Cel_Deudor.Text = Cel_Deudor.Text.Replace("\\", ","); if (Regex.IsMatch(Cel_Deudor.Text, "[^a-zA-Z0-9-/_() .,áéíóúÁÉÍÓÚñÑ`]")) { MessageBox.Show("En el campo escrito existe caracter especial no admitido. Reemplace y vuelva a presionar ENTER.", "ATENCIÓN", MessageBoxButtons.OK, MessageBoxIcon.Information); Cel_Deudor.Select(); return; } if (Co_deu.Text == "") { Co_deu.Select(); return; } Co_deu.Text = Co_deu.Text.Replace("&", "y"); Co_deu.Text = Co_deu.Text.Replace("'", "`"); Co_deu.Text = Co_deu.Text.Replace(";", ","); Co_deu.Text = Co_deu.Text.Replace("\\", ","); if (Regex.IsMatch(Co_deu.Text, "[^a-zA-Z0-9-/_() .,áéíóúÁÉÍÓÚñÑ`]")) { MessageBox.Show("En el campo escrito existe caracter especial no admitido. Reemplace y vuelva a presionar ENTER.", "ATENCIÓN", MessageBoxButtons.OK, MessageBoxIcon.Information); Co_deu.Select(); return; } if (CI_Codeu.Text == "") { CI_Codeu.Select(); return; } CI_Codeu.Text = CI_Codeu.Text.Replace("&", "y"); CI_Codeu.Text = CI_Codeu.Text.Replace("'", "`"); CI_Codeu.Text = CI_Codeu.Text.Replace(";", ","); CI_Codeu.Text = CI_Codeu.Text.Replace("\\", ","); if (Regex.IsMatch(CI_Codeu.Text, "[^a-zA-Z0-9-/_() .,áéíóúÁÉÍÓÚñÑ`]")) { MessageBox.Show("En el campo escrito existe caracter especial no admitido. Reemplace y vuelva a presionar ENTER.", "ATENCIÓN", MessageBoxButtons.OK, MessageBoxIcon.Information); CI_Codeu.Select(); return; } if (Dom_Codeu.Text == "") { Dom_Codeu.Select(); return; } Dom_Codeu.Text = Dom_Codeu.Text.Replace("&", "y"); Dom_Codeu.Text = Dom_Codeu.Text.Replace("'", "`"); Dom_Codeu.Text = Dom_Codeu.Text.Replace(";", ","); Dom_Codeu.Text = Dom_Codeu.Text.Replace("\\", ","); if (Regex.IsMatch(Dom_Codeu.Text, "[^a-zA-Z0-9-/_() .,áéíóúÁÉÍÓÚñÑ`]")) { MessageBox.Show("En el campo escrito existe caracter especial no admitido. Reemplace y vuelva a presionar ENTER.", "ATENCIÓN", MessageBoxButtons.OK, MessageBoxIcon.Information); Dom_Codeu.Select(); return; } if (Cel_Codeu.Text == "") { Cel_Codeu.Select(); return; } Cel_Codeu.Text = Cel_Codeu.Text.Replace("&", "y"); Cel_Codeu.Text = Cel_Codeu.Text.Replace("'", "`"); Cel_Codeu.Text = Cel_Codeu.Text.Replace(";", ","); Cel_Codeu.Text = Cel_Codeu.Text.Replace("\\", ","); if (Regex.IsMatch(Cel_Codeu.Text, "[^a-zA-Z0-9-/_() .,áéíóúÁÉÍÓÚñÑ`]")) { MessageBox.Show("En el campo escrito existe caracter especial no admitido. Reemplace y vuelva a presionar ENTER.", "ATENCIÓN", MessageBoxButtons.OK, MessageBoxIcon.Information); Cel_Codeu.Select(); return; } if (Simbolo.Text == "") { Simbolo.Select(); return; } Simbolo.Text = Simbolo.Text.Replace("&", "y"); Simbolo.Text = Simbolo.Text.Replace("'", "`"); Simbolo.Text = Simbolo.Text.Replace(";", ","); Simbolo.Text = Simbolo.Text.Replace("\\", ","); if (Regex.IsMatch(Simbolo.Text, "[^a-zA-Z0-9-/_() .,áéíóúÁÉÍÓÚñÑ`]")) { MessageBox.Show("En el campo escrito existe caracter especial no admitido. Reemplace y vuelva a presionar ENTER.", "ATENCIÓN", MessageBoxButtons.OK, MessageBoxIcon.Information); Simbolo.Select(); return; } if (Monto.Text == "") { Monto.Select(); return; } Monto.Text = Monto.Text.Replace("&", "y"); Monto.Text = Monto.Text.Replace("'", "`"); Monto.Text = Monto.Text.Replace(";", ","); Monto.Text = Monto.Text.Replace("\\", ","); if (Regex.IsMatch(Monto.Text, "[^a-zA-Z0-9-/_() .,áéíóúÁÉÍÓÚñÑ`]")) { MessageBox.Show("En el campo escrito existe caracter especial no admitido. Reemplace y vuelva a presionar ENTER.", "ATENCIÓN", MessageBoxButtons.OK, MessageBoxIcon.Information); Monto.Select(); return; } if (Num1P.Text == "") { Num1P.Select(); return; } Num1P.Text = Num1P.Text.Replace("&", "y"); Num1P.Text = Num1P.Text.Replace("'", "`"); Num1P.Text = Num1P.Text.Replace(";", ","); Num1P.Text = Num1P.Text.Replace("\\", ","); if (Regex.IsMatch(Num1P.Text, "[^a-zA-Z0-9-/_() .,áéíóúÁÉÍÓÚñÑ`]")) { MessageBox.Show("En el campo escrito existe caracter especial no admitido. Reemplace y vuelva a presionar ENTER.", "ATENCIÓN", MessageBoxButtons.OK, MessageBoxIcon.Information); Num1P.Select(); return; } if (Num2P.Text == "") { Num2P.Select(); return; } Num2P.Text = Num2P.Text.Replace("&", "y"); Num2P.Text = Num2P.Text.Replace("'", "`"); Num2P.Text = Num2P.Text.Replace(";", ","); Num2P.Text = Num2P.Text.Replace("\\", ","); if (Regex.IsMatch(Num2P.Text, "[^a-zA-Z0-9-/_() .,áéíóúÁÉÍÓÚñÑ`]")) { MessageBox.Show("En el campo escrito existe caracter especial no admitido. Reemplace y vuelva a presionar ENTER.", "ATENCIÓN", MessageBoxButtons.OK, MessageBoxIcon.Information); Num2P.Select(); return; } Global.FechaP = string.Format("{0:dd} de {0:MMMM} de {0:yyyy}", FechaC.Value); Global.Fecha_VP = string.Format("{0:dd-MM-yyyy}",FechaV.Value); Global.FechaVLP = string.Format("{0:dd} de {0:MMMM} de {0:yyyy}", FechaV.Value); Global.DeuP = Deudor.Text; Global.CI_DeuP = CI_deudor.Text; Global.Cel_DeuP = Cel_Deudor.Text; Global.Dom_DeuP = Dom_Deudor.Text; Global.Co_DeuP = Co_deu.Text; Global.CI_CoDeuP = CI_Codeu.Text; Global.Cel_CoDeuP = Cel_Codeu.Text; Global.Dom_CodP = Dom_Codeu.Text; Global.SimP = Simbolo.Text; Global.MontoP = string.Format("{0:#,##0.##}",double.Parse(Monto.Text)); Global.Num1P = int.Parse(Num1P.Text); Global.Num2P = int.Parse(Num2P.Text); pagarePDF pagarePDF = new pagarePDF(); pagarePDF.PagareMostrarPDF(); this.Close(); } private void button2_Click(object sender, EventArgs e) { if (panel1.Visible == false) { panel1.Visible = true; button2.Text = "Guardar"; this.AcceptButton = null; } else { if (Ciudad_Titu.Text == "") { Ciudad_Titu.Select(); return; } if (CI_titu.Text == "") { CI_titu.Select(); return; } if (Titular.Text == "") { Titular.Select(); return; } if (Text1.Text == "") { Text1.Select(); return; } { string SQLin = "UPDATE PAGARE_CONFIG SET TITULAR='" + Titular.Text + "',CI_TITU='" + CI_titu.Text + "',CIUDAD='" + Ciudad_Titu.Text + "',TEXTO1='" + Text1.Text + "';"; SQLiteCommand CMD = new SQLiteCommand(SQLin, Global.conexion); CMD.ExecuteNonQuery(); } Global.AquienP = Titular.Text; Global.CI_AquienP = CI_titu.Text; Global.CiudadP = Ciudad_Titu.Text; Global.Text_Pagare = Text1.Text; MessageBox.Show("La Configuración se guardó.", "¡Éxito!", MessageBoxButtons.OK, MessageBoxIcon.Information); panel1.Visible = false; button2.Text = "Configurar"; this.AcceptButton = Button1; } } private void Monto_KeyPress(object sender, KeyPressEventArgs e) { if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && (e.KeyChar != '.')) { e.Handled = true; } // solo 1 punto decimal if ((e.KeyChar == '.') && ((sender as TextBox).Text.IndexOf('.') > -1)) { e.Handled = true; } } private void Num1P_KeyPress(object sender, KeyPressEventArgs e) { if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && (e.KeyChar != '.')) { e.Handled = true; } // solo 1 punto decimal if ((e.KeyChar == '.') && ((sender as TextBox).Text.IndexOf('.') > -1)) { e.Handled = true; } } private void Num2P_TextChanged(object sender, EventArgs e) { } private void Num2P_KeyPress(object sender, KeyPressEventArgs e) { if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && (e.KeyChar != '.')) { e.Handled = true; } // solo 1 punto decimal if ((e.KeyChar == '.') && ((sender as TextBox).Text.IndexOf('.') > -1)) { e.Handled = true; } } private void Co_deu_TextChanged(object sender, EventArgs e) { if (Co_deu.Text.ToUpper() == "X") { Co_deu.Text = " "; CI_Codeu.Text = " "; Cel_Codeu.Text = " "; Dom_Codeu.Text = " "; } } private void button3_Click_1(object sender, EventArgs e) { Close(); } private void Btn_Cerrar_Click(object sender, EventArgs e) { Close(); } } public class pagarePDF { public object PagareMostrarPDF() { //CREAR PDF string pdfgenerate = "\\DOC_PDF\\PAGARES_PDF\\" + Global.AquienP + "_" + DateTime.Now.ToString("dd-MM-yy") + "_" + DateTime.Now.ToString("HH-mm") + "_REPORTE.pdf"; iTextSharp.text.Document oDoc; iTextSharp.text.pdf.PdfWriter pdfw; PdfContentByte cb; float top1; //PREPARA EL PDF oDoc = new iTextSharp.text.Document(PageSize.A4, 30, 20, 20, 20); pdfw = PdfWriter.GetInstance(oDoc, new FileStream(pdfgenerate, FileMode.Create, FileAccess.Write, FileShare.None)); pdfw.CompressionLevel = PdfStream.BEST_COMPRESSION; pdfw.SetFullCompression(); oDoc.Open(); oDoc.NewPage(); top1 = oDoc.PageSize.Top; try { //ENCABEZADO LOGO (usado en reportes) Image logo = Image.GetInstance("logo.png", true); logo.CompressionLevel = PdfStream.NO_COMPRESSION; //logo.SetAbsolutePosition(60, top1 - 130); oDoc.Add(logo); } catch (Exception) { } cb = pdfw.DirectContent;//DEBE IR ANTES DE LAS LÍNEAS DE TEXTO // Creamos un titulo personalizado con tamaño de fuente 10 y color Azul Paragraph title = new Paragraph(); title.Font = FontFactory.GetFont(FontFactory.TIMES, 18f, BaseColor.BLACK); title.Alignment = Element.ALIGN_CENTER; title.Add("PAGARÉ\n\n_"); oDoc.Add(title); PdfPTable table = new PdfPTable(3); Phrase Titulo1 = new Phrase("Vencimiento", FontFactory.GetFont(FontFactory.TIMES_ROMAN, 12, BaseColor.BLACK)); PdfPCell TEXTO_T1 = new PdfPCell(Titulo1); TEXTO_T1.HorizontalAlignment = Element.ALIGN_LEFT; TEXTO_T1.BackgroundColor = new BaseColor(255, 255, 255); TEXTO_T1.BorderColor = new BaseColor(255, 255, 255);//125,125,255 Phrase Titulo2 = new Phrase("PAGARÉ", FontFactory.GetFont(FontFactory.TIMES, 12, BaseColor.BLACK)); PdfPCell TEXTO_T2 = new PdfPCell(Titulo2); TEXTO_T2.HorizontalAlignment = Element.ALIGN_CENTER; TEXTO_T2.BackgroundColor = new BaseColor(255, 255, 255); TEXTO_T2.BorderColor = new BaseColor(255, 255, 255);//125,125,255 Phrase Titulo3 = new Phrase(" ", FontFactory.GetFont(FontFactory.TIMES_ROMAN, 12, BaseColor.BLACK)); PdfPCell TEXTO_T3 = new PdfPCell(Titulo3); TEXTO_T3.HorizontalAlignment = Element.ALIGN_RIGHT; TEXTO_T3.BackgroundColor = new BaseColor(255, 255, 255); TEXTO_T3.BorderColor = new BaseColor(255, 255, 255);//125,125,255 table.HorizontalAlignment = 0; table.TotalWidth = 545f;//TAMAÑO TOTAL DEL ANCHO table.LockedWidth = true;//ANCHO BLOQUEADO float[] widths = new float[] { 70f, 80f, 395f };//DISTRIBUCIÓN DE ANCHO DE LAS COLUMNAS table.SetWidths(widths); //AGREGA LAS CELDAS table.AddCell(TEXTO_T1); table.AddCell(TEXTO_T2); table.AddCell(TEXTO_T3); //AGREGANDO UNA FILA Y TRES COLUMNAS Phrase Conte1 = new Phrase(Global.Fecha_VP, FontFactory.GetFont(FontFactory.TIMES, 12, BaseColor.BLACK)); PdfPCell art = new PdfPCell(Conte1); art.HorizontalAlignment = Element.ALIGN_LEFT; art.BackgroundColor = new BaseColor(255, 255, 255); art.BorderColor = new BaseColor(255, 255, 255);//125,125,255 Phrase Conte2 = new Phrase(Global.Num1P + "/" + Global.Num2P, FontFactory.GetFont(FontFactory.TIMES, 12, BaseColor.BLACK)); PdfPCell can = new PdfPCell(Conte2); can.HorizontalAlignment = Element.ALIGN_CENTER; can.BackgroundColor = new BaseColor(255, 255, 255); can.BorderColor = new BaseColor(255, 255, 255);//125,125,255 Phrase Conte3 = new Phrase(Global.CiudadP + ", " + Global.FechaP + "\n_", FontFactory.GetFont(FontFactory.TIMES, 12, BaseColor.BLACK)); PdfPCell pre = new PdfPCell(Conte3); pre.HorizontalAlignment = Element.ALIGN_RIGHT; pre.BackgroundColor = new BaseColor(255, 255, 255); pre.BorderColor = new BaseColor(255, 255, 255);//125,125,255 table.AddCell(art); table.AddCell(can); table.AddCell(pre); oDoc.Add(table); //TABLA DEL CUERPO PdfPTable table2 = new PdfPTable(1); NumLet numLet = new NumLet(); string totalLetra = numLet.enletras(Global.MontoP); Phrase Cuerpo = new Phrase("\nMonto: " + Global.SimP + Global.MontoP + "\n\nEl día " + Global.FechaVLP + ", pagaré al Señor/a " + Global.AquienP.ToUpper() + ", titular de la cédula de identidad N° " + Global.CI_AquienP + ", en su domicilio sin protesto y solidariamente, la cantidad de " + Global.SimP + Global.MontoP + ". (" + totalLetra.Trim() + ").\n" + Global.Text_Pagare + "\n_", FontFactory.GetFont(FontFactory.TIMES, 12, BaseColor.BLACK)); PdfPCell Cuer = new PdfPCell(Cuerpo); Cuer.HorizontalAlignment = Element.ALIGN_JUSTIFIED; Cuer.BackgroundColor = new BaseColor(255, 255, 255); Cuer.BorderColor = new BaseColor(255, 255, 255);//125,125,255 Cuer.BorderWidth = 0; table2.HorizontalAlignment = 0; table2.TotalWidth = 545f;//TAMAÑO TOTAL DEL ANCHO table2.LockedWidth = true;//ANCHO BLOQUEADO float[] width = new float[] { 545f };//DISTRIBUCIÓN DE ANCHO DE LAS COLUMNAS table2.SetWidths(width); table2.AddCell(Cuer); oDoc.Add(table2); //TABLA DE LAS FIRMAS PdfPTable table3 = new PdfPTable(2); //RAYITA PARA FIRMAR1 Phrase FirmaA1 = new Phrase("\n\n\n\n________________________________", FontFactory.GetFont(FontFactory.TIMES, 12, BaseColor.BLACK)); PdfPCell FirA1 = new PdfPCell(FirmaA1); FirA1.HorizontalAlignment = Element.ALIGN_CENTER; FirA1.BackgroundColor = new BaseColor(255, 255, 255); FirA1.BorderColor = new BaseColor(255, 255, 255);//125,125,255 FirA1.BorderWidth = 0; //RAYITA PARA FIRMAR2 Phrase FirmaA2 = new Phrase("\n\n\n\n________________________________", FontFactory.GetFont(FontFactory.TIMES, 12, BaseColor.BLACK)); PdfPCell FirA2 = new PdfPCell(FirmaA2); FirA2.HorizontalAlignment = Element.ALIGN_CENTER; FirA2.BackgroundColor = new BaseColor(255, 255, 255); FirA2.BorderColor = new BaseColor(255, 255, 255);//125,125,255 FirA2.BorderWidth = 0; //DEUDOR NOMBRE Phrase Firma1 = new Phrase(Global.DeuP.ToUpper(), FontFactory.GetFont(FontFactory.TIMES, 12, BaseColor.BLACK)); PdfPCell Fir1 = new PdfPCell(Firma1); Fir1.HorizontalAlignment = Element.ALIGN_CENTER; Fir1.BackgroundColor = new BaseColor(255, 255, 255); Fir1.BorderColor = new BaseColor(255, 255, 255);//125,125,255 Fir1.BorderWidth = 0; //CO-DEUDOR NOMBRE Phrase Firma2 = new Phrase(Global.Co_DeuP.ToUpper(), FontFactory.GetFont(FontFactory.TIMES, 12, BaseColor.BLACK)); PdfPCell Fir2 = new PdfPCell(Firma2); Fir2.HorizontalAlignment = Element.ALIGN_CENTER; Fir2.BackgroundColor = new BaseColor(255, 255, 255); Fir2.BorderColor = new BaseColor(255, 255, 255);//125,125,255 Fir2.BorderWidth = 0; //CI DEUDOR Phrase CI1 = new Phrase("C.I. N°" + Global.CI_DeuP, FontFactory.GetFont(FontFactory.TIMES, 12, BaseColor.BLACK)); PdfPCell ci1 = new PdfPCell(CI1); ci1.HorizontalAlignment = Element.ALIGN_CENTER; ci1.BackgroundColor = new BaseColor(255, 255, 255); ci1.BorderColor = new BaseColor(255, 255, 255);//125,125,255 ci1.BorderWidth = 0; //CI CO-DEUDOR Phrase CI2 = new Phrase("C.I. N°" + Global.CI_CoDeuP, FontFactory.GetFont(FontFactory.TIMES, 12, BaseColor.BLACK)); PdfPCell ci2= new PdfPCell(CI2); ci2.HorizontalAlignment = Element.ALIGN_CENTER; ci2.BackgroundColor = new BaseColor(255, 255, 255); ci2.BorderColor = new BaseColor(255, 255, 255);//125,125,255 ci2.BorderWidth = 0; //DOMICILIO DEUDOR Phrase DOM1 = new Phrase("Domicilio: " + Global.Dom_DeuP.ToUpper(), FontFactory.GetFont(FontFactory.TIMES, 12, BaseColor.BLACK)); PdfPCell do1 = new PdfPCell(DOM1); do1.HorizontalAlignment = Element.ALIGN_CENTER; do1.BackgroundColor = new BaseColor(255, 255, 255); do1.BorderColor = new BaseColor(255, 255, 255);//125,125,255 do1.BorderWidth = 0; //DOMICILIO CO-DEUDOR Phrase DOM2 = new Phrase("Domicilio: " + Global.Dom_CodP.ToUpper(), FontFactory.GetFont(FontFactory.TIMES, 12, BaseColor.BLACK)); PdfPCell do2 = new PdfPCell(DOM2); do2.HorizontalAlignment = Element.ALIGN_CENTER; do2.BackgroundColor = new BaseColor(255, 255, 255); do2.BorderColor = new BaseColor(255, 255, 255);//125,125,255 do2.BorderWidth = 0; //TEL DEUDOR Phrase TELE1 = new Phrase("Tel: " + Global.Cel_DeuP, FontFactory.GetFont(FontFactory.TIMES, 12, BaseColor.BLACK)); PdfPCell tel1 = new PdfPCell(TELE1); tel1.HorizontalAlignment = Element.ALIGN_CENTER; tel1.BackgroundColor = new BaseColor(255, 255, 255); tel1.BorderColor = new BaseColor(255, 255, 255);//125,125,255 tel1.BorderWidth = 0; //TEL CO-DEUDOR Phrase TELE2 = new Phrase("Tel: " + Global.Cel_CoDeuP, FontFactory.GetFont(FontFactory.TIMES, 12, BaseColor.BLACK)); PdfPCell tel2 = new PdfPCell(TELE2); tel2.HorizontalAlignment = Element.ALIGN_CENTER; tel2.BackgroundColor = new BaseColor(255, 255, 255); tel2.BorderColor = new BaseColor(255, 255, 255);//125,125,255 tel2.BorderWidth = 0; //DEUDOR TITULO Phrase DEU1 = new Phrase("DEUDOR", FontFactory.GetFont(FontFactory.COURIER_BOLD, 12, BaseColor.BLACK)); PdfPCell de1 = new PdfPCell(DEU1); de1.HorizontalAlignment = Element.ALIGN_CENTER; de1.BackgroundColor = new BaseColor(255, 255, 255); de1.BorderColor = new BaseColor(255, 255, 255);//125,125,255 de1.BorderWidth = 0; //CO-DEUDOR TITULO Phrase DEU2 = new Phrase("CO-DEUDOR", FontFactory.GetFont(FontFactory.COURIER_BOLD, 12, BaseColor.BLACK)); PdfPCell de2 = new PdfPCell(DEU2); de2.HorizontalAlignment = Element.ALIGN_CENTER; de2.BackgroundColor = new BaseColor(255, 255, 255); de2.BorderColor = new BaseColor(255, 255, 255);//125,125,255 de2.BorderWidth = 0; table3.HorizontalAlignment = 0; table3.TotalWidth = 545f;//TAMAÑO TOTAL DEL ANCHO table3.LockedWidth = true;//ANCHO BLOQUEADO float[] widt = new float[] { 272.5f, 272.5f };//DISTRIBUCIÓN DE ANCHO DE LAS COLUMNAS table3.SetWidths(widt); table3.AddCell(FirA1); table3.AddCell(FirA2); table3.AddCell(Fir1); table3.AddCell(Fir2); table3.AddCell(ci1); table3.AddCell(ci2); table3.AddCell(do1); table3.AddCell(do2); table3.AddCell(tel1); table3.AddCell(tel2); table3.AddCell(de1); table3.AddCell(de2); oDoc.Add(table3); pdfw.Flush(); oDoc.Close(); System.Diagnostics.Process.Start(@pdfgenerate);//MUESTRA EL REPORTE EN PDF return (null); } } }