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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to create PDF document in memory and email?

Thread ID:





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

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 06:19 PM UTC

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

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

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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon