I would like to know if it is possible to create a PDF document in memory and then email it? I'm using the following code which creates an attachment but the document is corrupt?
MemoryStream stream = new MemoryStream();
document.Save(stream);
stream.Position = 0;
document.Close(true);
Attachment file = new Attachment(stream, strFileName, "application/pdf" );
Thanks