小编Mit*_*ati的帖子

从流中读取 pdf 时未找到 PDF 标头签名,

我正在从 blob 容器下载文件并保存到流中并尝试阅读 pdf。

            //creating a Cloud Storage instance
        CloudStorageAccount StorageAccount = CloudStorageAccount.Parse(connectionstring);
        //Creating a Client to operate on blob
        CloudBlobClient blobClient = StorageAccount.CreateCloudBlobClient();
        // fetching the container based on name
        CloudBlobContainer container = blobClient.GetContainerReference(containerName);
        //Get a reference to a blob within the container.
        CloudBlockBlob blob = container.GetBlockBlobReference(fileName);
        var memStream = new MemoryStream();
        blob.DownloadToStream(memStream);
        try
        {
            PdfReader reader = new PdfReader(memStream);
        }
        catch(Exception ex)
        {

        }
Run Code Online (Sandbox Code Playgroud)

例外:未找到 PDF 标头签名。

c# itext azure-storage-blobs

0
推荐指数
1
解决办法
2712
查看次数

标签 统计

azure-storage-blobs ×1

c# ×1

itext ×1