Last post Aug 09, 2017 07:20 PM by funluckykitty
Member
26 Points
98 Posts
May 31, 2017 11:21 AM|sanjaykumar pushadapu|LINK
cssfile: .imagepdfchk { content: url(https://d30y9cdsu7xlg0.cloudfront.net/png/2180-200.png); width: 15px; height: 15px;
code: MemoryStream ms = new MemoryStream(); Document pdfDoc = new Document(PageSize.A4, 30f, 20f, 80f, 15f); var writer = PdfWriter.GetInstance(pdfDoc, ms); pdfDoc.Open();
consentFormData="<br/> <span class='imagepdfchk'></span> " + txtbox.Text; using (var cssMemoryStream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(cssText))) { using (var htmlMemoryStream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(consentFormData))) { XMLWorkerHelper.GetInstance().ParseXHtml(writer, pdfDoc, htmlMemoryStream, cssMemoryStream); } }
pdfDoc.Close();
here image is not loading
Participant
1131 Points
1693 Posts
Aug 09, 2017 07:20 PM|funluckykitty|LINK
Here's the sample I followed when I was working with iTextSharp... Hope it helps.. http://www.c-sharpcorner.com/blogs/add-image-in-pdf-using-itextsharp1
Member
26 Points
98 Posts
loading image in pdf view
May 31, 2017 11:21 AM|sanjaykumar pushadapu|LINK
cssfile:
.imagepdfchk {
content: url(https://d30y9cdsu7xlg0.cloudfront.net/png/2180-200.png);
width: 15px;
height: 15px;
code:
MemoryStream ms = new MemoryStream();
Document pdfDoc = new Document(PageSize.A4, 30f, 20f, 80f, 15f);
var writer = PdfWriter.GetInstance(pdfDoc, ms);
pdfDoc.Open();
consentFormData="<br/> <span class='imagepdfchk'></span> " + txtbox.Text;
using (var cssMemoryStream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(cssText)))
{
using (var htmlMemoryStream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(consentFormData)))
{
XMLWorkerHelper.GetInstance().ParseXHtml(writer, pdfDoc, htmlMemoryStream, cssMemoryStream);
}
}
pdfDoc.Close();
here image is not loading
Participant
1131 Points
1693 Posts
Re: loading image in pdf view
Aug 09, 2017 07:20 PM|funluckykitty|LINK
Here's the sample I followed when I was working with iTextSharp... Hope it helps.. http://www.c-sharpcorner.com/blogs/add-image-in-pdf-using-itextsharp1