小编Scy*_*312的帖子

PDFsharp - 从 System.Byte[] 变量打开 PDF

我正在使用 PDFsharp,并且尝试打开一个表示为 Byte[] 变量的 PDF。这是一个简化的示例:

public Byte[] myFunc(Byte[] PDF)
{
    PdfDocument document = PdfReader.Open(PDF_Path); // <-- My problem is here
    // do some modification on the document
    return document;
}
Run Code Online (Sandbox Code Playgroud)

我可以从 PDF 的路径中读取 PDF,但我宁愿将 PDF 作为字节数组来使用。将字节数组另存为 PDF 然后读取它,然后删除我创建的文件是否是更好的选择?我觉得这种方法不合适。

.net pdf byte filestream pdfsharp

3
推荐指数
1
解决办法
7819
查看次数

标签 统计

.net ×1

byte ×1

filestream ×1

pdf ×1

pdfsharp ×1