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