# EpubSharp **Repository Path**: lutaining/EpubSharp ## Basic Information - **Project Name**: EpubSharp - **Description**: C# library for reading EPUB file format - **Primary Language**: Unknown - **License**: MPL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-01-29 - **Last Updated**: 2022-06-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # EpubSharp C# library for reading and writing EPUB files. Supported EPUB versions: **2.0**, **3.0**, **3.1** # Installation ``` Install-Package EpubSharp.dll ``` # Usage ### Reading an EPUB ```cs // Read an epub file EpubBook book = EpubReader.Read("my.epub"); // Read metadata string title = book.Title; string[] authors = book.Authors; Image cover = book.CoverImage; // Get table of contents ICollection chapters = book.TableOfContents; // Get contained files ICollection html = book.Resources.Html; ICollection css = book.Resources.Css; ICollection images = book.Resources.Images; ICollection fonts = book.Resources.Fonts; // Convert to plain text string text = book.ToPlainText(); // Access internal EPUB format specific data structures. EpubFormat format = book.Format; OcfDocument ocf = format.Ocf; OpfDocument opf = format.Opf; NcxDocument ncx = format.Ncx; NavDocument nav = format.Nav; // Create an EPUB EpubWriter.Write(book, "new.epub"); ``` ### Writing an EPUB _**Editing capabilities are currently very limited and might not work at all. Use it at your own risk. The next release will bring a true write support.**_ ```cs EpubWriter writer = new EpubWriter(); writer.AddAuthor("Foo Bar"); writer.SetCover(imgData, ImageFormat.Png); writer.Write("new.epub"); ```