My documents are stored in a database that I want to send mail with attachments.
I want to convert stored docx to 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); }How can I convert document_content to pdf?