-1

エクスポート中に、1 つの pdf が目的の場所にダウンロードされますが、別の余分な pdf がダウンロード フォルダーにダウンロードされます

余分なPDFのダウンロードを停止するには?

            Response.ContentType = "application/pdf";
            Response.AddHeader("content-disposition", "attachment;filename=" + Projname + ".pdf");
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            System.IO.StringWriter stringWrite = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
            design.RenderControl(htmlWrite);
            string myText = stringWrite.ToString().Replace("&", "&");
            StringReader sr = new StringReader(myText.ToString());
            Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 100f, 0f);
            string strPath = "D:\\WeeklyReport of " + Projname + ".pdf";
            PdfWriter writer = PdfWriter.GetInstance(pdfDoc, new FileStream(strPath, FileMode.Create));
            pdfDoc.Open();
            XMLWorkerHelper.GetInstance().ParseXHtml(writer, pdfDoc, sr);
            pdfDoc.Close();
            pdfDoc.Dispose();
4

1 に答える 1