Set table background image in string builderArchit Shrivastava8yAsked Sep 4, 2018, 9:32 PM EDT3 answersShareLinkedInXCopy linkSavei want to set image on string builder table.sb.Append("") Here.3 AnswersKnow the answer? Post it. Somebody with the same question will find it here.Nanddeep NachanRank #38 · 35.2K reputation8y agoPosted Sep 4, 2018, 9:51 PM EDT0Please try below: sb.Append("") 0Archit ShrivastavaRank #3,125 · 458 reputation8y agoPosted Sep 4, 2018, 10:00 PM EDT0sir but this image not showing in pdf document why?firstly i want to set background image and then print data over the image . 0Archit ShrivastavaRank #3,125 · 458 reputation8y agoPosted Sep 4, 2018, 10:02 PM EDT0this is ny full code StringBuilder sb = new StringBuilder(); sb.Append(""); foreach (DataGridViewRow row in dgv_preview.Rows) { bool isSelected = Convert.ToBoolean(row.Cells["checkBoxColumn"].Value); if (isSelected) { sb.Append(" " + row.Cells["REGT NO"].Value.ToString() + ""); sb.Append("" + row.Cells["Full Name"].Value.ToString() + ""); sb.Append("" + row.Cells["RANK"].Value.ToString() + " "); sb.Append("" + row.Cells["Aadharno"].Value.ToString() + "" + " "); sb.Append(""); } } sb.Append(""); StringReader sr = new StringReader(sb.ToString()); string path = "C:\\Users\\Archit\\Desktop\\test.pdf"; StringWriter sw = new StringWriter(); var output = new FileStream(path, FileMode.Create); iTextSharp.text.Document pdfDoc = new iTextSharp.text.Document(PageSize.A4, 10F, 10F, 10F, 0F); HTMLWorker htmlparser = new HTMLWorker(pdfDoc); iTextSharp.text.pdf.PdfWriter.GetInstance(pdfDoc, output); pdfDoc.Open(); htmlparser.Parse(sr); pdfDoc.Close(); 0Join to answer this questionEvery answer you publish earns 20 SHARP.Create free accountSign inKnow the answer?Answer a question in the forums and earn +20 SHARP for every answer.See unanswered questionsForumsTop experts01Arun PottiAnswers in the forums20answers02Tahir AnsariAnswers in the forums5answers03Kamlesh KumarAnswers in the forums5answers04Sam HobbsAnswers in the forums4answers05Željko PerićAnswers in the forums3answers?YouYour name goes here.Every answer: 20 SHARP.JoinFull leaderboard →2026DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Set table background image in string builderArchit Shrivastava8yAsked Sep 4, 2018, 9:32 PM EDT3 answersShareLinkedInXCopy linkSavei want to set image on string builder table.sb.Append("") Here.3 AnswersKnow the answer? Post it. Somebody with the same question will find it here.Nanddeep NachanRank #38 · 35.2K reputation8y agoPosted Sep 4, 2018, 9:51 PM EDT0Please try below: sb.Append("") 0Archit ShrivastavaRank #3,125 · 458 reputation8y agoPosted Sep 4, 2018, 10:00 PM EDT0sir but this image not showing in pdf document why?firstly i want to set background image and then print data over the image . 0Archit ShrivastavaRank #3,125 · 458 reputation8y agoPosted Sep 4, 2018, 10:02 PM EDT0this is ny full code StringBuilder sb = new StringBuilder(); sb.Append(""); foreach (DataGridViewRow row in dgv_preview.Rows) { bool isSelected = Convert.ToBoolean(row.Cells["checkBoxColumn"].Value); if (isSelected) { sb.Append(" " + row.Cells["REGT NO"].Value.ToString() + ""); sb.Append("" + row.Cells["Full Name"].Value.ToString() + ""); sb.Append("" + row.Cells["RANK"].Value.ToString() + " "); sb.Append("" + row.Cells["Aadharno"].Value.ToString() + "" + " "); sb.Append(""); } } sb.Append(""); StringReader sr = new StringReader(sb.ToString()); string path = "C:\\Users\\Archit\\Desktop\\test.pdf"; StringWriter sw = new StringWriter(); var output = new FileStream(path, FileMode.Create); iTextSharp.text.Document pdfDoc = new iTextSharp.text.Document(PageSize.A4, 10F, 10F, 10F, 0F); HTMLWorker htmlparser = new HTMLWorker(pdfDoc); iTextSharp.text.pdf.PdfWriter.GetInstance(pdfDoc, output); pdfDoc.Open(); htmlparser.Parse(sr); pdfDoc.Close(); 0Join to answer this questionEvery answer you publish earns 20 SHARP.Create free accountSign inKnow the answer?Answer a question in the forums and earn +20 SHARP for every answer.See unanswered questionsForumsTop experts01Arun PottiAnswers in the forums20answers02Tahir AnsariAnswers in the forums5answers03Kamlesh KumarAnswers in the forums5answers04Sam HobbsAnswers in the forums4answers05Željko PerićAnswers in the forums3answers?YouYour name goes here.Every answer: 20 SHARP.JoinFull leaderboard →2026DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Nanddeep NachanRank #38 · 35.2K reputation8y agoPosted Sep 4, 2018, 9:51 PM EDT0Please try below: sb.Append("") 0Archit ShrivastavaRank #3,125 · 458 reputation8y agoPosted Sep 4, 2018, 10:00 PM EDT0sir but this image not showing in pdf document why?firstly i want to set background image and then print data over the image . 0Archit ShrivastavaRank #3,125 · 458 reputation8y agoPosted Sep 4, 2018, 10:02 PM EDT0this is ny full code StringBuilder sb = new StringBuilder(); sb.Append(""); foreach (DataGridViewRow row in dgv_preview.Rows) { bool isSelected = Convert.ToBoolean(row.Cells["checkBoxColumn"].Value); if (isSelected) { sb.Append(" " + row.Cells["REGT NO"].Value.ToString() + ""); sb.Append("" + row.Cells["Full Name"].Value.ToString() + ""); sb.Append("" + row.Cells["RANK"].Value.ToString() + " "); sb.Append("" + row.Cells["Aadharno"].Value.ToString() + "" + " "); sb.Append(""); } } sb.Append(""); StringReader sr = new StringReader(sb.ToString()); string path = "C:\\Users\\Archit\\Desktop\\test.pdf"; StringWriter sw = new StringWriter(); var output = new FileStream(path, FileMode.Create); iTextSharp.text.Document pdfDoc = new iTextSharp.text.Document(PageSize.A4, 10F, 10F, 10F, 0F); HTMLWorker htmlparser = new HTMLWorker(pdfDoc); iTextSharp.text.pdf.PdfWriter.GetInstance(pdfDoc, output); pdfDoc.Open(); htmlparser.Parse(sr); pdfDoc.Close(); 0Join to answer this questionEvery answer you publish earns 20 SHARP.Create free accountSign inKnow the answer?Answer a question in the forums and earn +20 SHARP for every answer.See unanswered questionsForumsTop experts01Arun PottiAnswers in the forums20answers02Tahir AnsariAnswers in the forums5answers03Kamlesh KumarAnswers in the forums5answers04Sam HobbsAnswers in the forums4answers05Željko PerićAnswers in the forums3answers?YouYour name goes here.Every answer: 20 SHARP.JoinFull leaderboard →2026DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Archit ShrivastavaRank #3,125 · 458 reputation8y agoPosted Sep 4, 2018, 10:00 PM EDT0sir but this image not showing in pdf document why?firstly i want to set background image and then print data over the image . 0
Archit ShrivastavaRank #3,125 · 458 reputation8y agoPosted Sep 4, 2018, 10:02 PM EDT0this is ny full code StringBuilder sb = new StringBuilder(); sb.Append(""); foreach (DataGridViewRow row in dgv_preview.Rows) { bool isSelected = Convert.ToBoolean(row.Cells["checkBoxColumn"].Value); if (isSelected) { sb.Append(" " + row.Cells["REGT NO"].Value.ToString() + ""); sb.Append("" + row.Cells["Full Name"].Value.ToString() + ""); sb.Append("" + row.Cells["RANK"].Value.ToString() + " "); sb.Append("" + row.Cells["Aadharno"].Value.ToString() + "" + " "); sb.Append(""); } } sb.Append(""); StringReader sr = new StringReader(sb.ToString()); string path = "C:\\Users\\Archit\\Desktop\\test.pdf"; StringWriter sw = new StringWriter(); var output = new FileStream(path, FileMode.Create); iTextSharp.text.Document pdfDoc = new iTextSharp.text.Document(PageSize.A4, 10F, 10F, 10F, 0F); HTMLWorker htmlparser = new HTMLWorker(pdfDoc); iTextSharp.text.pdf.PdfWriter.GetInstance(pdfDoc, output); pdfDoc.Open(); htmlparser.Parse(sr); pdfDoc.Close(); 0
Nanddeep NachanRank #38 · 35.2K reputationPosted Sep 4, 2018, 9:51 PM EDT
Archit ShrivastavaRank #3,125 · 458 reputationPosted Sep 4, 2018, 10:00 PM EDT
Archit ShrivastavaRank #3,125 · 458 reputationPosted Sep 4, 2018, 10:02 PM EDT
");
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts