TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Archit Shrivastava
NA
416
117.3k
set background image string builder
Sep 6 2018 2:06 AM
i have a image of id card i want to set this image as a table background and set dynamic data over the image .
now the problem is i craete string builder table and set image to table background but when i print the card to pdf image not showing on pdf only table and data is sowing.
how to set image on pdf background and print data over the image.
here the code sample
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();
iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(@"C:\Users\Archit\Downloads\itbp.jpg");
image.ScaleAbsolute(545, 157);
pdfDoc.Add(image);
htmlparser.Parse(sr);
pdfDoc.Close();
Reply
Answers (
2
)
set Kruti Dev 010 into string builder
background image not show in pdf