VB.NET function that returns PDF?
I'm tr开发者_Python百科ying to create a function that would return a PDF document. Something like this:
Function GetPDF(ByVal DirectoryPath as String) as PDF
Return DirectoryPath
End Function
Any way to do this? Thanks!
What are you trying to do with it? Manipulate it? Serve it to a client?
Generally speaking you'd return a Stream...
Function GetPDF(ByVal filePath as String) as FileStream
Return File.OpenRead(filePath);
End Function
or an array of Bytes...
Function GetPDF(ByVal filePath as String) as Byte()
Return File.ReadAllBytes(filePath);
End Function
精彩评论