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
close icon

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

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

1 Reply

GM Geetha M Syncfusion Team June 13, 2012 11:41 AM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon