2

I have files in e pub format. I have to show their contents to the user. How do I read them in asp.net? Can it be done through javascript?

user1509
  • 1,151
  • 5
  • 17
  • 45

3 Answers3

3

Authoritative? What could be better then a StackOverflow answer? I started from this question ( https://stackoverflow.com/questions/4870594/is-there-a-c-sharp-epub-library ) and gleaned a few usefull links:

You can't do this with just JavaScript of course, you'll have a server side like a web service or code behind on your asp.net webpage which opens the epub file, extracts the contents as HTML and returns it to the client, but I think there is enough here to get you started.

Community
  • 1
  • 1
Peter
  • 9,643
  • 6
  • 61
  • 108
2

Just to add then i suggest the steps:

Step 1: unzip the file using C#,.net code having some third party library.

Refer : recommend a library/API to unzip file in C#

Step 2: Check whether in the extracted folder there is only one file or more.

Refer: How do I find out how many files are in a directory?

Step 3 :Read the file using stream reader in c#.net

Refer: http://msdn.microsoft.com/en-us/library/aa328963(v=vs.71).aspx

http://www.dotnetperls.com/streamreader

Community
  • 1
  • 1
Pratik
  • 1,472
  • 7
  • 20
  • 36
2

Epub file is actually a zip archive that contains

  • xml files for meta data, table of contents etc
  • xhtml or dtbook (xml) + gif, jpeg, png, svg + css for content

To be able to display epub you will have to be able to handle all of the above. Here Reading ePub format you'll find what you have to do to open epub step by step - it's an example for iphone, but it should be enough.

Community
  • 1
  • 1
c2h5oh
  • 4,492
  • 2
  • 23
  • 30