下面是我生成示例 PDF 文件的代码。但是 server.mappath 方法将文件保存在项目文件夹中。如何让 PDF 文件保存在我自己的桌面上?
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;
}