【发布时间】:2025-12-06 07:25:01
【问题描述】:
我需要将 doc 或 docx 文件转换为 PDF。我有字节数组格式的文档文件。需要在不使用存储的情况下将该字节数组转换为 PDF。无论如何只使用内存来做到这一点。我使用存储转换的代码如下。
string outputFileName = destinationFile;
Interopwrd.Application wordApp = new Interopwrd.Application();
Interopwrd.Document wordDoc = null;
wordDoc = wordApp.Documents.Open(sourceFile);
wordDoc.ExportAsFixedFormat(outputFileName, Interopwrd.WdExportFormat.wdExportFormatPDF);
我需要在不保存存储的情况下执行此操作。有可能吗?
【问题讨论】:
标签: c# file-conversion export-to-pdf