从昨晚开始我就一直在看这个问题,只是不知道如何解决它。
2个错误,一个说,Type FileResult is not defined
。
另一个说,Type FileStreamResult is not defined
。
Imports System
Imports System.IO
Imports System.Collections.Generic
Imports System.Text
Imports EO.Pdf
Imports System.Collections.Specialized
Partial Class getRecs
Inherits System.Web.UI.Page
Public Function Download() As FileResult
' Populate list with urls
Dim qParams As String = Request.QueryString("p")
Dim urls() As String = qParams.Split(","c, ChrW(StringSplitOptions.RemoveEmptyEntries))
Dim documents = New List(Of EO.Pdf.PdfDocument)()
For Each url In urls
Dim doc = New EO.Pdf.PdfDocument()
EO.Pdf.HtmlToPdf.ConvertUrl(url, doc)
documents.Add(doc)
Next
Dim mergedDocument As EO.Pdf.PdfDocument = EO.Pdf.PdfDocument.Merge(documents.ToArray())
Dim ms = New MemoryStream()
mergedDocument.Save(ms)
ms.Position = 0
Return New FileStreamResult(ms, "application/pdf") With { _
.FileDownloadName = "download.pdf" _
}
End Function
End Class
提前致谢。