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.
Syncfusion Feedback

How to create PDF document in memory and email?

Thread ID:

Created:

Updated:

Platform:

Replies:

115799 Feb 6,2014 07:55 PM UTC May 19,2014 08:52 AM UTC ASP.NET Web Forms (Classic) 2
loading
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();
            document.Save(stream);
            stream.Position = 0;
            document.Close(true);
            Attachment file = new Attachment(stream, strFileName, "application/pdf" ); 

Thanks

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.

Thanks,
Suresh

CONFIRMATION

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.

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

;