Hi,
I didn’t try to save the document trough stream, but if you continue stuck in that, you could save the document as a file and attach it to e-mail trough path to file.
Code:
PdfDocument document = new PdfDocument();
(…)
String filename = "HelloWorld.pdf";
document.Save(filename);
MailMessage mail = new MailMessage();
mail.Attachments.Add(new Attachment(filename));
(…)
//After send it and if want to delete the file, you have to explicitly dispose mail to release the file
mail.Dispose();
new FileInfo(filename).Delete();
Regards,
David