下面的代碼流的PDF文件瀏覽器,但我想保存到磁盤(C:\ myfile.pdf)...保存PDF到DISC
Dim FilePath As String = Server.MapPath("/docs/templates/page_1_cover.pdf")
Dim reader As New PdfReader(FilePath)
Dim output As MemoryStream = New MemoryStream()
Dim stamper As PdfStamper = New PdfStamper(reader, output)
stamper.AcroFields.SetField("APPLICANT NAME", "KnowlegeZone")
reader.Close()
stamper.Close()
Response.AddHeader("Content-Disposition", "attachment; filename=YourPDF_I9.pdf")
Response.ContentType = "application/pdf"
Response.BinaryWrite(output.ToArray())
Response.End()
我使用iTextSharp的。
會將此流的瀏覽器,並保存到磁盤? – highwingers
是的。這將寫入文件並將其發送到瀏覽器。 – nunespascal