如何在 C# / Vb.net 中将数组字节写入 PDF/A-3 和附件 [关闭]

How to write byte of array to PDF/A-3 and attachment in C# / Vb.net [Close]

我想将 PDF 转换为 PDF/a-3 作为 byte[] 和文件附件。

我试过了iTextSharp from these example PDF/AConvert.NET

但问题是我无法在我的方案中使用 File.WriteAllBytes(),因为我必须避免在目录中写入文件。

在另一种方式中,我将 pdfData 作为字节数组,如何将其写入 pdf/a-3

如果有其他解决方案就好了, 请帮忙。

您不需要使用 FileStream; you can use a MemoryStream 写入物理文件直接写入内存,然后将其用作您的流。

FileStreamMemoryStream 都派生自 Stream.