I am not getting image in pdf i only get text, please help me, i m using iteshsharp 5.2.1 from http://sourceforge.net/projects/itextsharp/
Code of default.aspx.cs
Response.ContentType = "application/pdf";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
savetopdf.RenderControl(hw);
StringReader sr = new StringReader(sw.ToString());
Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 0f);
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
pdfDoc.Open();
htmlparser.Parse(sr);
pdfDoc.Close();
Response.Write(pdfDoc);
Response.End();
缺省法典。
<form id="form1" runat="server">
<div id="savetopdf" runat="server">
<asp:Label ID="lbl" runat="server" Text=" Lorem Ipsum, Dolor"></asp:Label>
<img src="http://localhost:5583/WebSite1/images/Penguins.jpg" alt="penguins" />
<img src="http://localhost:5583/WebSite1/images/Tulips.jpg" alt="tulips" />
</div>
</form>