title: Export div content to pdf format
body: <p>I used the following code to export div content to pdf format using itextsharp</p>
  
  <pre><code>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);
  Panel1.RenderControl(hw);
  StringReader sr = new StringReader(sw.ToString());
  // Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 100f, 0f);
  Document pdfDoc = new Document(new Rectangle(1000f, 1000f));
  HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
  PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
  pdfDoc.Open();
  htmlparser.Parse(sr);
  pdfDoc.Close();
  Response.Write(pdfDoc);
  Response.End();
  </code></pre>
  
  <p>it shows the following error</p>
  
  <pre><code>Could not find a part of the path 'C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\Images\logo.png'.`
  </code></pre>
  
  <p>if i hide the logo in desin then it exported to pdf but the alignment are missing. how to correct it.The page i need to export is follows
  <img src="https://i.stack.imgur.com/rWSxV.png" alt="enter image description here"></p>