【问题标题】:VB.NET function that returns PDF?返回PDF的VB.NET函数?
【发布时间】:2011-05-09 15:42:45
【问题描述】:

我正在尝试创建一个返回 PDF 文档的函数。像这样的:

Function GetPDF(ByVal DirectoryPath as String) as PDF
   Return DirectoryPath
End Function

有什么办法吗?谢谢!

【问题讨论】:

  • 问题是一旦你有了这个功能,你想用这个文件做什么。
  • 你想做什么?将文件转换为 PDF?将 PDF 转换为其他内容?在内存中加载 PDF 并对其进行操作? (提示,最后一个不容易,最好不要直接尝试)

标签: vb.net function pdf return


【解决方案1】:

你想用它做什么?操纵它?提供给客户?

一般来说你会返回一个Stream...

Function GetPDF(ByVal filePath as String) as FileStream

    Return File.OpenRead(filePath);

End Function

或一个字节数组...

Function GetPDF(ByVal filePath as String) as Byte()

    Return File.ReadAllBytes(filePath);

End Function

【讨论】:

    猜你喜欢
    • 2023-03-14
    • 2016-02-05
    • 2018-03-28
    • 1970-01-01
    • 1970-01-01
    • 2011-10-21
    • 1970-01-01
    • 2023-03-21
    • 1970-01-01
    相关资源
    最近更新 更多