We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to create PDF document in memory and email?

Thread ID:





115799 Feb 6,2014 02:55 PM May 19,2014 04:52 AM ASP.NET Web Forms (Classic) 2
Tags: PDF
Dharmesh Desai
Asked On February 6, 2014 02:55 PM

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();
            stream.Position = 0;
            Attachment file = new Attachment(stream, strFileName, "application/pdf" ); 


Dharmesh Desai
Replied On February 7, 2014 01:19 PM

I solved this issue by adding stream.Seek(0,SeekOrigin.Begin).

Suresh M [Syncfusion]
Replied On May 19, 2014 04:52 AM

Hi Dharmesh,

Thank you for using Syncfusion products.

We are glad to hear that your issue is resolved, please let us know if you need any further assistance.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.