{
Document pdfDoc = new Document(PageSize.A4, 10, 10, 10, 10);
try
{
PdfWriter.GetInstance(pdfDoc, System.Web.HttpContext.Current.Res
ponse.OutputStream);
//Open PDF Document to write data
pdfDoc.Open();
iTextSharp.text.Font _standardFont = new iTextSharp.text.Font(iT
extSharp.text.Font.FontFamily.HELVETICA, 8, iTextSharp.text.Font.NORMAL, BaseCol
or.BLACK);
pdfDoc.Add(new Paragraph("Orden Aprobada"));
pdfDoc.Add(Chunk.NEWLINE);
string cadenaFinal = "";
PdfPTable tblPrueba = new PdfPTable(2);
PdfPCell cl1 = new PdfPCell(new Phrase("", _standardFont));
PdfPCell cl2 = new PdfPCell(new Phrase("", _standardFont));
tblPrueba.AddCell(cl1);
tblPrueba.AddCell(cl2);
cl1 = new PdfPCell(new Phrase("ID_Venta", _standardFont));
cl2 = new PdfPCell(new Phrase( TextBox1.Text , _standardFont));
tblPrueba.AddCell(cl1);
tblPrueba.AddCell(cl2);
cl1 = new PdfPCell(new Phrase("Nit del Cliente", _standardFont))
;
cl2 = new PdfPCell(new Phrase(nitdelcliente(Convert.ToInt32(Text
Box1.Text)), _standardFont));
tblPrueba.AddCell(cl1);
tblPrueba.AddCell(cl2);
cl1 = new PdfPCell(new Phrase("Nombre", _standardFont));
cl2 = new PdfPCell(new Phrase(nombrecliente(nitdelcliente(Conver
t.ToInt32(TextBox1.Text))), _standardFont));
tblPrueba.AddCell(cl1);
tblPrueba.AddCell(cl2);
cl1 = new PdfPCell(new Phrase("Domicilio", _standardFont));
cl2 = new PdfPCell(new Phrase(dircliente(nitdelcliente(Convert.T
oInt32(TextBox1.Text))), _standardFont));
tblPrueba.AddCell(cl1);
tblPrueba.AddCell(cl2);
cl1 = new PdfPCell(new Phrase("nit del Vendedor", _standardFont)
);
cl2 = new PdfPCell(new Phrase(nitvendedor(), _standardFont));
tblPrueba.AddCell(cl1);
tblPrueba.AddCell(cl2);
pdfDoc.Add(tblPrueba);
//Close your PDF
pdfDoc.Close();
Response.ContentType = "application/pdf";