protected void GeneratePDFwithImage(string DID,string DocType) { string path = Server.MapPath("~/TenderDocument"); string fileName = "TPR1" + DateTime.Now.Ticks + ".pdf"; Document doc = new Document(); DataTable dtBidTree = new DataTable(); BidTreeBLL objBID = new BidTreeBLL(); dtBidTree = objBID.GetBidTree(DID, DocType); try { if (dtBidTree.Rows.Count > 0) { int btParentNodeID; string btName = string.Empty; string btType = string.Empty; string btDetails = string.Empty; bool btChagable = false; string sbtDID1 = string.Empty; for (int m = 1; m < dtBidTree.Rows.Count; m++) // starting from 1 because, 0th row value not required { string NodeValue = string.Empty; NodeValue=dtBidTree.Rows[m]["btNodeID"].ToString(); NodeValue=dtBidTree.Rows[m]["btParentNodeID"].ToString(); NodeValue = dtBidTree.Rows[m]["btName"].ToString(); NodeValue = dtBidTree.Rows[m]["btType"].ToString(); NodeValue = dtBidTree.Rows[m]["btDetails"].ToString(); NodeValue=dtBidTree.Rows[m]["btChangable"].ToString(); PdfWriter.GetInstance(doc, new FileStream(path + fileName, FileMode.Create)); doc.Open(); dtBidTree = objBID.GetBidTree(DID, DocType); //doc.Add(new Paragraph("Hello World")); //here doc.Add(NodeValue);but am getting error..so how can i bind to doc.add //its generating only logo. iTextSharp.text.Image gif = iTextSharp.text.Image.GetInstance(Server.MapPath("~/images/CompanyLogo.JPG")); doc.Add(gif); } } } catch (Exception ex) { lblMessage.Text = ex.ToString(); } finally { doc.Close(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)