title: Specify the location to save the pdf file asp.net
body: <p>Below is my code which generates a sample PDF file. However the server.mappath method saves the file at the project folder. How do i allow the PDF file to be saved in my own desktop?</p>
  
  <pre><code>protected void btnPDF_Click(object sender, EventArgs e)
      {
  
  
          var document = new Document(PageSize.A4, 50, 50, 25, 25);
          var filename = DDLCase.SelectedItem.Text + ".pdf";
          var output = new FileStream(Server.MapPath(filename), FileMode.Create);
          var writer = PdfWriter.GetInstance(document, output);
          document.Open();
          var welcomeParagraph = new Paragraph("Test1");
          document.Add(welcomeParagraph);
          document.Close();
          btnPDF.Enabled= false;
      }
  </code></pre>