Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone


I want to export page as pdf with image or logo.


When I export the page all data and controls are shown in pdf file except the image!!??


I designed the page as table with many rows & I put backgroundimage the system logo


HTML
<td style="background-image:removed('Images/ARS_header.png');background-repeat: no-repeat;background-removed: center top;" class="style8">
          </td>



and this export code:

VB
Response.ContentType = "application/pdf"
      Response.AddHeader("content-disposition", "attachment;filename=Status.pdf")
      Response.Cache.SetCacheability(HttpCacheability.NoCache)
      Dim sw As New StringWriter()
      Dim hw As New HtmlTextWriter(sw)
      pnlPerson.RenderControl(hw)
      Dim sr As New StringReader(sw.ToString())
      Dim pdfDoc As New Document(PageSize.A4, 10.0F, 10.0F, 100.0F, 0.0F)
      Dim htmlparser As New HTMLWorker(pdfDoc)
      PdfWriter.GetInstance(pdfDoc, Response.OutputStream)
      pdfDoc.Open()
      htmlparser.Parse(sr)
      pdfDoc.Close()
      Response.Write(pdfDoc)
      Response.End()



Thank you
Posted

1 solution

I'm not sure what is the exact problem, but I've had problems embedding PNG images inside PDF files. I tried converting images to JPEG, and it worked.
 
Share this answer
 
Comments
ITTIHAD FC. 10-Jul-14 3:58am    
It doesn`t work

Thank you Shameel

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900