MemoryStream ms = new MemoryStream();
Document doc = new Document(PageSize.A4, 10f, 10f, 100f, 0.0f); //require custom parsers? add here. PdfWriter writer = PdfWriter.GetInstance(doc, ms); doc.Open(); //open doc for editing //do layout //doc.Add(new Paragraph("First Paragraph")); //doc.Add(new Paragraph("Second Paragraph")); writer.CloseStream = false; //important doc.Close(); //build the doc. memoryStream.Position = 0; //reset stream... important
mail.Attachments.Add(new Attachment(ms, "filename.pdf"));
smtp.Send(mail);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)