As we all know .epub is a collection of files. Does anyone have an idea how can we read all that files embed in .epub runtime using C#?
The ePub specification supports two formats, a collection of files or a package of files. Most epub's use the packaging. The package is simply a ZIP file with a renamed extension.
The specification can be found here. The OEBPS Container wraps around an ePub version of the Open Packaging Format.
The simplest way to read the content is to unzip the files and look at the xhtml files that were embedded within it.
It is a zip file so how about using the Compression namespace to read the contents. Haven't use it but I'm sure this namespace exposes classes to read zip files as a stream.
I found EPUB Sharp. Unfortunately, not released yet.
http://epubsharp.sourceforge.net/
You have to use the gitden reader or you can use iBook if you are using iOS.
Free online ePub reader focusing on the social aspects of reading. Now closed, but the concept has moved to: http://www.readups.com/ per: http://www.bookglutton.com/
Source: Wikipedia
Supports EPUB 2 and EPUB 3. Books not readable directly on computers other than Macs.
Related
Is there any way for me to read contents of an xml file in a cab file in C#? I know how to use XDocument to load an xml file and read its contents, but not sure if it is possible to read an xml file that is zipped up in a cab file.
Any ideas?
What you are looking to do is to extract the contents of the CAB file first. You can either write the code to do that yourself or use a 3rd party library.
I have not used this personally, but I have seen it mentioned several times on this site and others: http://www.codeproject.com/KB/files/CABCompressExtract.aspx
To take a stab at writing it yourself, refer to the documentation here: http://msdn.microsoft.com/en-us/library/cc483132%28EXCHG.80%29.aspx
I have an .odt wordprocessing file, to be processed with libre office or Word, and I need to replace a bunch (20+) of strings in the text with other text.
I know an .odt file is really a .zip file, containing .xml files and that i need to access content.xml.
Do I unzip the content.xml to a stream, deserialize that and use LINQ or something?
Or is there an easier way, using some ready-made library?
If you're using .Net 4.5 you can make use of the new System.IO.Compression namespace. There are a couple articles out there on how to do it. Here's one http://www.codeguru.com/csharp/.net/zip-and-unzip-files-programmatically-in-c.htm
which I've found useful.
Suppose, I have a list of MP3 files on my server. And I want a user to download multiple files (which he wants through any means). For, this what i want is to create the zip file dynamically and while saving it into the Output Stream using the dotnetzip or ioniczip libraries.
Well, that's not the perfect solution if the zip file got heavy in size. As, in that scenario the server doesn't support resumable downloads. So, to overcome this approach, I need to handle the zip file structure internally and provide the resume support.
So, is there any library (open source) which i can use to provide resumable dyanamic zip files stream directly to the Output Stream. Or, if possible I will be happy if someone let me know the structure of zip file specially the header content + data content.
Once a download has started, you should not alter the ZIP file anymore. Because then a resume will just result in a broken ZIP file. So make sure your dynamically created ZIP file stays available!
The issue of providing resume-functionality was solved in this article for .NET 1.1, and it is still valid and functional.
I have a single file, Setup1.cab, which is split up into Setup1.zip.001 and Setup1.zip.002 that I used 7zip to archive. Once those volumes reach their destination, I'd like to be able to use C# to extract that file from both archives into the same directory where they will reside. Is this something that SharpZipLib is capable of, or should I be using another tool?
Otherwise, is there a way to combine the two using C# (or another tool - I'm open!) into one zip file, THEN extract it using SharpZipLib?
Thanks!
EDIT: 7zip will not be installed on the destination machines. Also, I'm open to using a different method of archiving the original file; I just need it to be in chunks of under 500MB, and the original file is 570MB.
I would take a look at the SevenZipSharp library and actually use 7zip via C# to handle the decompression.
How can i download a zipped folder from a remote server and unzip the entire files in the folder and store them in isolated storage space from a silver light 3 or 4 out of browser application. Any suggestion please
You can download a zip file like any files with the Webclient class, look at the details and examples in the msdn documentation for downloading content on demand it even talks about how to download and get a specific file from a zip archive.
However if you want to list the files, check out this blogpost, I've not actually tried it but it shows how to get all the files in a zip archive.
Edit: I also found this discussion which offers some ideas, it among other things mentions this Small unzip utility for Silverlight, which seems a bit more robust.
Then use the IsolatedStorageFile class to save the files.
Good Luck!
Ola
For the (un)zipping I'd highly recommend that you use the open source DotNetZip library. DotNetZip is licensed under the Ms-PL and really easy to use.
Zipping for example is easy too:
using (ZipFile zip = new ZipFile())
{
zip.AddEntry("MyFileName.png", null, pngStream);
// Save to stream from SaveFileDialog
zip.Save(stream);
}
Silverlight SharpZipLib is a full Silverlight 3/4 and Phone7 port, less AES encryption, of SharpZipLib.
The salient limitation is one that you will find in all Silverlight compression: Only UTF8 encoding of entry meta is supported.
you could get the file using http or frp stream and then use GZipStream (.NET Class) for unziping the stream/file.
GzipStream:
http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx
Cheers
--Jocke