我的文档存储在我想用附件发送邮件的数据库中。将docx转换为pdf
我想将存储的docx转换为pdf。
var result = from c in valinor.documents
select new
{
c.document_name,
c.document_size,
c.document_content
};
var kk = result.ToList();
for (int i = 0; i<kk.Count; i++)
{
MemoryStream stream = new MemoryStream(kk[i].document_content);
Attachment attachment = new Attachment(stream, kk[i].document_name + ".pdf", "application/pdf");
mail.Attachments.Add(attachment);
}
如何将document_content
转换为pdf?
你试过了什么?这里有一种可能性,搜索功能返回http://stackoverflow.com/questions/8817623/converting-docx-to-pdf-using-openxml-and-pdfcreator-in-c-sharp – Chuck 2013-03-12 14:17:14
'流'内容是文档或pdf – 2013-03-12 14:19:03
流内容一docx – user1065131 2013-03-12 14:38:54