ASPX page <asp:Image ID="ImageAsset" runat="server" Width="100" Height="100" />
CS page ImageAsset.ImageUrl = "http://localhost:55589/WebSite1/ResidentialImageStorage/download.jpg";
Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=Panel.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); pnlPerson.RenderControl(hw); StringReader sr = new StringReader(sw.ToString()); Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 20f, 20f); //Left, Right, Top, Bottom //pdfDoc.HtmlStyleClass = "~/css/style.css"; HTMLWorker htmlparser = new HTMLWorker(pdfDoc); PdfWriter.GetInstance(pdfDoc, Response.OutputStream); pdfDoc.Open(); htmlparser.Parse(sr); pdfDoc.Close(); Response.Write(pdfDoc); Response.End();
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE