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.

Is there any methods to convert the memory stream object in to Html format

Thread ID:

Created:

Updated:

Platform:

Replies:

103945 Jun 11,2012 08:45 AM Jun 13,2012 07:41 AM ASP.NET MVC (Classic) 1
loading
Tags: PDF
Arjun Gudla
Asked On June 11, 2012 08:45 AM

Hi,

I have an browse button whenever i am selecting a pdf file it has to be read and copied in to database
it is working fine and from the database i want to convert the pdf object in to html format and i want 
to display it in a editor.The thing is i am display the content but it is not html but it is like some converted language and not human understandable.

Please anybody tell me how to convert it in to html format.i have used memory stream and stream reader methods.I am sending my display function code

public ActionResult Display()
        {
 
            try
            { var query = (from i in dbContext.Pdffiles
                             where i.Id == 1
                             select new { Name = i.File }).FirstOrDefault();
 

                byte[] buffer = (byte[])query.Name;
System.IO.MemoryStream ms = new System.IO.MemoryStream(buffer);
 PdfLoadedDocument ldDoc = new PdfLoadedDocument(ms);
MemoryStream m = new MemoryStream();
                ldDoc.Save(m);
                m.Seek(0, SeekOrigin.Begin);
                StreamReader sr = new StreamReader(m,?);//i think i need to write some additional functionality.please tell me any body having any idea 
                
                var s = sr.ReadToEnd();
 

                return Json(s, JsonRequestBehavior.AllowGet);
 

 
            }
            catch (NotSupportedException) { return Json(new { st = "exception" }); }


Thanks and Regards

Geetha M [Syncfusion]
Replied On June 13, 2012 07:41 AM

Hi Srinivas,

Thank you for your interest in Syncfusion products.

PDF saved as memory stream will be in PDF format. Hence it is not possible to read them as text. The PDF need to be converted to HTML format. Currently we do not have support for PDF to HTML conversion.

Please let me know if you have any questions.

Regards
Geetha

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.

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.

;