title: Saving ASP.NET Chart to PDF
body: <p>I try to save image from ASP.NET chart control to pdf.
  I've found this solution on the Internet:</p>
  
  <pre><code>Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 0f);
  PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
  pdfDoc.Open();
  using (MemoryStream stream = new MemoryStream())
  {
      Chart1.SaveImage(stream, ChartImageFormat.Png);
      iTextSharp.text.Image chartImage = iTextSharp.text.Image.GetInstance(stream.GetBuffer());
      chartImage.ScalePercent(75f);
      pdfDoc.Add(chartImage);
      pdfDoc.Close();
  
      Response.ContentType = "application/pdf";
      Response.AddHeader("content-disposition", "attachment;filename=Chart.pdf");
      Response.Cache.SetCacheability(HttpCacheability.NoCache);
      Response.Write(pdfDoc);
      Response.End();
  }
  </code></pre>
  
  <p>But when i run this code nothing happens (window with question where to save PDF won't appear).</p>
  
  <p>In web.config i have this:</p>
  
  <pre><code>&lt;add key="ChartImageHandler" value="storage=session;timeout=360;" /&gt;
  </code></pre>
  
  <p>I cannot save file with defined file path.</p>
  
  <p>Please help :)</p>