更新时间:2023-11-15 19:54:10
您可以通过关闭文件来在文档完成之前检索文档字节:
You retrieve the document bytes before the document is finished by closing:
var bytes = memoryStream.ToArray();
var encodedPDF = Convert.ToBase64String(bytes);
document.Close();
将关闭调用移到ToArray调用之前.
Move the close call before the ToArray call.