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. Image for the cookie policy date

Is it possible to convert the memory stream in to pdf or doc or image format

Hi,

In my database i am saving the files in memory stream format.But i want to display the memory stream 
in another format.Is it possible to convert the memory stream to another format like pdf or image or doc
based on the requirement of user.
The thing is i want to convert the saved memory stream in to required format of the user it may be pdf or doc 
or image.If possible please provide me a sample code

Thank You


10 Replies

KD Kesavan D Syncfusion Team July 17, 2012 09:29 AM UTC

Hi Srinivas,

Thank you for using Syncfusion products.

We request you to provide the original format of file in memory stream stored in the database. It would be helpful for us provide an appropriate solution.

Please let us know if you have any questions.

Regards,

Kesavan



AG Arjun Gudla July 17, 2012 09:56 AM UTC

Hi,

I am using three different files for saving in to database 
the three files are pdf,doc and text files


Thank You


AG Arjun Gudla July 18, 2012 05:53 AM UTC

Hi,

I am using only word format to save to database
Please provide me sample regarding the word format


Thanks and Regards,
Srinivas


KD Kesavan D Syncfusion Team July 18, 2012 10:13 AM UTC

Hi Srinivas,

Thank you for using Syncfusion products.

We have created a sample for retrieving the memory stream from the database and convert it to PDF document , Word Document or Image. We have attached the sample in this post.

Please verify the sample let us know if this helps.

Regards,

Kesavan



Sample 104376_985a9421.zip


AG Arjun Gudla July 18, 2012 10:39 AM UTC

Hi kesavan,

Thanks for the Fast Reply,
It was useful but i don't want to save the file to the local drive i want to open the file in the browser 
and i want to display the content of the file to be placed in an editor.
I have tried for the browser like

                Response.ContentType = "application/pdf";
                Response.AddHeader("content-disposition", "inline;filename=d:/doctopdf.pdf");
                Response.AddHeader("content-length", ms.Length.ToString());
                Response.BinaryWrite(ms.ToArray());
                Response.End();
But it is not working 
And i also want to display the content in to an editor based on the user requirement for 
the browser or for the editor, Is it possible 
Please provide me a sample 


Thanks and Regards
Srinivas



KD Kesavan D Syncfusion Team July 20, 2012 09:29 AM UTC

Hi Srinivas,

 

Thank you for using Syncfusion products.

We have created a sample for retrieving the memory stream from the database and convert it to PDF document , Word Document or Image and display it using browser. We have attached the sample in this post.

We are not clear about the term editor could you please provide a detailed information on it. So we could guide you in the same.

Please verify the sample let us know if this helps.


Regards,

Kesavan



Sample 104376_bd32e1c1.zip


AG Arjun Gudla July 20, 2012 10:26 AM UTC

Hi,

I don't want to save the files to the local directory.After converting it to pdf format i want to display the 
format in a textarea which is present in the view 
Here in your code you are saving the file to local directory but i don't want to do that.
Hope you understand my question now


Thanks and Regards
Srinivas



KD Kesavan D Syncfusion Team July 26, 2012 10:54 AM UTC

Hi Srinivas,

 

Thank you for using Syncfusion products.

 

“pdfDoc.Save("DoctoPDF.pdf", Response, HttpReadType.Open);”   

 

The above statement does not save the file to the local directory, it opens the generated document using the browser plugin.

 

Please let us know if you have any  questions.

 

Regards,

Kesavan



OS OSMAN November 30, 2020 08:57 PM UTC

Dear Kesavan 

Please can you resend the mentioned zipped sample, I have the same problem and the mentioned link not working Sample 104376_985a9421.zip
Kindest regards,
Osman




GK Gowthamraj Kumar Syncfusion Team December 1, 2020 03:24 PM UTC

Hi OSMAN, 

Thank you for your update. 

We can save the memory stream into PDF document and open it directly into the browser window. Please refer to the below link for more information, 

Please let us know if you need any further assistance with this. 

Regards, 
Gowthamraj K 


Loader.
Live Chat Icon For mobile
Up arrow icon