All Projects → vers-one → Epubreader

vers-one / Epubreader

Licence: unlicense
.NET library for reading EPUB files

Labels

Projects that are alternatives of or similar to Epubreader

The Economist Ebooks
经济学人(含音频)、纽约客、自然、新科学人、卫报、科学美国人、连线、大西洋月刊、新闻周刊、国家地理等英语杂志免费下载、订阅(kindle推送),支持epub、mobi、pdf格式, 每周更新. The Economist 、The New Yorker 、Nature、The Atlantic 、New Scientist、The Guardian、Scientific American、Wired、Newsweek magazines, free download and subscription for kindle, mobi、epub、pdf format.
Stars: ✭ 3,471 (+1463.51%)
Mutual labels:  epub
Manifold
Transforming scholarly publications into living digital works.
Stars: ✭ 163 (-26.58%)
Mutual labels:  epub
Pandoc Markdown Book Template
A template for creating epub books from markdown using pandoc.
Stars: ✭ 191 (-13.96%)
Mutual labels:  epub
Books
IT技术书籍文字版mobi epub格式
Stars: ✭ 131 (-40.99%)
Mutual labels:  epub
Webpages To Ebook
Create an EPUB from a list of URLs. Standing on the shoulders of Wget, Readability and Pandoc.
Stars: ✭ 155 (-30.18%)
Mutual labels:  epub
Epub Specs
Shared workspace for EPUB 3 specifications.
Stars: ✭ 164 (-26.13%)
Mutual labels:  epub
Worm Scraper
Scrapes the web serial Worm and its sequel Ward into an eBook format
Stars: ✭ 118 (-46.85%)
Mutual labels:  epub
Bookdown
Authoring Books and Technical Documents with R Markdown
Stars: ✭ 2,768 (+1146.85%)
Mutual labels:  epub
Epubviewer
ePub viewer with dictionary, themes, search, offline support, and more
Stars: ✭ 156 (-29.73%)
Mutual labels:  epub
Comics Downloader
tool to download comics and manga in pdf/epub/cbr/cbz from a website
Stars: ✭ 190 (-14.41%)
Mutual labels:  epub
Shirah Reader
RSVP speed reader, written in python.
Stars: ✭ 133 (-40.09%)
Mutual labels:  epub
Dart Epub
Epub Reader and Writer for Dart
Stars: ✭ 146 (-34.23%)
Mutual labels:  epub
Asciidoctor Epub3
📘 Asciidoctor EPUB3 is a set of Asciidoctor extensions for converting AsciiDoc to EPUB3 & KF8/MOBI
Stars: ✭ 166 (-25.23%)
Mutual labels:  epub
Novel Grabber
Novel-Grabber can download novels from pretty much any webnovel and lightnovel site.
Stars: ✭ 125 (-43.69%)
Mutual labels:  epub
Folioreaderkit
📚 A Swift ePub reader and parser framework for iOS.
Stars: ✭ 2,382 (+972.97%)
Mutual labels:  epub
Markdownslides
MarkdownSlides is a Reveal.js and PDF slides generator from MARKDOWN files, that also generate HTML, EPUB and DOCX documents. The idea is that from a same MARKDOWN file we can get slides and books without worrying about style, just worrying about content.
Stars: ✭ 121 (-45.5%)
Mutual labels:  epub
Folioreader Android
A Java ePub reader and parser framework for Android.
Stars: ✭ 2,025 (+812.16%)
Mutual labels:  epub
Comicbook
epub comic generator | nhentai.net | e-hentai.org | wnacg.org
Stars: ✭ 222 (+0%)
Mutual labels:  epub
Pandoc Book Template
A simple Pandoc template to build documents and ebooks.
Stars: ✭ 214 (-3.6%)
Mutual labels:  epub
Blitz
An eBook Framework (CSS + template)
Stars: ✭ 179 (-19.37%)
Mutual labels:  epub

EpubReader

.NET library for reading EPUB files.

Supports .NET Framework >= 4.6, .NET Core >= 1.0, and .NET Standard >= 1.3.

Supports EPUB 2 (2.0, 2.0.1) and EPUB 3 (3.0, 3.0.1, 3.1).

Download | WPF & .NET Core demo apps

Migration from 2.x

How to migrate from 2.x to 3.x

Example

// Opens a book and reads all of its content into memory
EpubBook epubBook = EpubReader.ReadBook("alice_in_wonderland.epub");

            
// COMMON PROPERTIES

// Book's title
string title = epubBook.Title;

// Book's authors (comma separated list)
string author = epubBook.Author;

// Book's authors (list of authors names)
List<string> authors = epubBook.AuthorList;

// Book's cover image (null if there is no cover)
byte[] coverImageContent = epubBook.CoverImage;
if (coverImageContent != null)
{
    using (MemoryStream coverImageStream = new MemoryStream(coverImageContent))
    {
        Image coverImage = Image.FromStream(coverImageStream);
    }
}
            
// TABLE OF CONTENTS

// Enumerating chapters
foreach (EpubNavigationItem chapter in epubBook.Navigation)
{
    // Title of chapter
    string chapterTitle = chapter.Title;
                
    // Nested chapters
    List<EpubNavigationItem> subChapters = chapter.NestedItems;
}

// READING ORDER

// Enumerating the whole text content of the book in the order of reading
foreach (EpubTextContentFile textContentFile in book.ReadingOrder)
{
    // HTML of current text content file
    string htmlContent = textContentFile.Content;
}

            
// CONTENT

// Book's content (HTML files, stlylesheets, images, fonts, etc.)
EpubContent bookContent = epubBook.Content;

            
// IMAGES

// All images in the book (file name is the key)
Dictionary<string, EpubByteContentFile> images = bookContent.Images;

EpubByteContentFile firstImage = images.Values.First();

// Content type (e.g. EpubContentType.IMAGE_JPEG, EpubContentType.IMAGE_PNG)
EpubContentType contentType = firstImage.ContentType;

// MIME type (e.g. "image/jpeg", "image/png")
string mimeType = firstImage.ContentMimeType;

// Creating Image class instance from the content
using (MemoryStream imageStream = new MemoryStream(firstImage.Content))
{
    Image image = Image.FromStream(imageStream);
}

// Cover metadata
if (bookContent.Cover != null)
{
    string coverFileName = bookContent.Cover.FileName;
    EpubContentType coverContentType = bookContent.Cover.ContentType;
    string coverMimeType = bookContent.Cover.ContentMimeType;
}

// HTML & CSS

// All XHTML files in the book (file name is the key)
Dictionary<string, EpubTextContentFile> htmlFiles = bookContent.Html;

// All CSS files in the book (file name is the key)
Dictionary<string, EpubTextContentFile> cssFiles = bookContent.Css;

// Entire HTML content of the book
foreach (EpubTextContentFile htmlFile in htmlFiles.Values)
{
    string htmlContent = htmlFile.Content;
}

// All CSS content in the book
foreach (EpubTextContentFile cssFile in cssFiles.Values)
{
    string cssContent = cssFile.Content;
}


// OTHER CONTENT

// All fonts in the book (file name is the key)
Dictionary<string, EpubByteContentFile> fonts = bookContent.Fonts;

// All files in the book (including HTML, CSS, images, fonts, and other types of files)
Dictionary<string, EpubContentFile> allFiles = bookContent.AllFiles;


// ACCESSING RAW SCHEMA INFORMATION

// EPUB OPF data
EpubPackage package = epubBook.Schema.Package;

// Enumerating book's contributors
foreach (EpubMetadataContributor contributor in package.Metadata.Contributors)
{
    string contributorName = contributor.Contributor;
    string contributorRole = contributor.Role;
}

// EPUB 2 NCX data
Epub2Ncx epub2Ncx = epubBook.Schema.Epub2Ncx;

// Enumerating EPUB 2 NCX metadata
foreach (Epub2NcxHeadMeta meta in epub2Ncx.Head)
{
    string metadataItemName = meta.Name;
    string metadataItemContent = meta.Content;
}

// EPUB 3 navigation
Epub3NavDocument epub3NavDocument = epubBook.Schema.Epub3NavDocument;

// Accessing structural semantics data of the head item
StructuralSemanticsProperty? ssp = epub3NavDocument.Navs.First().Type;

More examples

  1. How to extract the plain text of the whole book.
  2. How to extract the table of contents.
  3. How to iterate over all EPUB files in a directory and collect some statistics.

Download latest stable release

Via NuGet package from nuget.org

DLL file from GitHub: for .NET Framework (38.3 KB) / for .NET Core (38.4 KB) / for .NET Standard (38.4 KB)

Demo apps

Download WPF demo app (WpfDemo.zip, 479 KB)

This .NET Framework application demonstrates how to open EPUB books and extract their content using the library.

HTML renderer used in this demo app may have difficulties while rendering HTML content for some of the books if the HTML structure is too complicated.

Download .NET Core console demo app (NetCoreDemo.zip, 17.6 MB)

This .NET Core console application demonstrates how to open EPUB books and retrieve their text content.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].