Show / Hide Table of Contents

Class EpubBookRef

Represents a EPUB book with its metadata. An instance of this class holds a reference to the EPUB file to load book's content on demand.

Inheritance
object
EpubBookRef
Implements
IDisposable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VersOne.Epub
Assembly: VersOne.Epub.dll
Syntax
public class EpubBookRef : IDisposable

Constructors

View Source

EpubBookRef(IZipFile, string?, string, string, List<string>?, string?, EpubSchema, EpubContentRef, EpubReaderOptions?)

Initializes a new instance of the EpubBookRef class.

Declaration
public EpubBookRef(IZipFile epubFile, string? filePath, string title, string author, List<string>? authorList, string? description, EpubSchema schema, EpubContentRef content, EpubReaderOptions? epubReaderOptions = null)
Parameters
Type Name Description
IZipFile epubFile

Reference to the EPUB file.

string filePath

The path to the EPUB file or null if the EPUB file is being loaded from a stream.

string title

The title of the book.

string author

The comma separated list of the book's authors.

List<string> authorList

The list of book's authors names.

string description

The book's description or null if the description is not present in the book.

EpubSchema schema

The parsed EPUB schema of the book.

EpubContentRef content

The collection of references to the book's content files within the EPUB archive.

EpubReaderOptions epubReaderOptions

Various options to configure the behavior of the EPUB reader.

Exceptions
Type Condition
ArgumentNullException

The epubFile parameter is null.

ArgumentNullException

The title parameter is null.

ArgumentNullException

The author parameter is null.

ArgumentNullException

The schema parameter is null.

ArgumentNullException

The content parameter is null.

Properties

View Source

Author

Gets the comma separated list of the book's authors.

Declaration
public string Author { get; }
Property type: string
View Source

AuthorList

Gets the list of book's authors names.

Declaration
public List<string> AuthorList { get; }
Property type: List<string>
View Source

Content

Gets the collection of references to the book's content files within the EPUB archive.

Declaration
public EpubContentRef Content { get; }
Property type: EpubContentRef
View Source

Description

Gets the book's description or null if the description is not present in the book.

Declaration
public string? Description { get; }
Property type: string
View Source

EpubFile

Gets the reference to the EPUB file.

Declaration
public IZipFile EpubFile { get; }
Property type: IZipFile
View Source

EpubReaderOptions

Gets the options that configure the behavior of the EPUB reader.

Declaration
public EpubReaderOptions EpubReaderOptions { get; }
Property type: EpubReaderOptions
View Source

FilePath

Gets the path to the EPUB file or null if the EPUB file was loaded from a stream.

Declaration
public string? FilePath { get; }
Property type: string
View Source

Schema

Gets the parsed EPUB schema of the book.

Declaration
public EpubSchema Schema { get; }
Property type: EpubSchema
View Source

Title

Gets the title of the book.

Declaration
public string Title { get; }
Property type: string

Methods

View Source

Dispose()

Releases the managed resources used by the EpubBookRef.

Declaration
public void Dispose()
View Source

Dispose(bool)

Releases the resources used by the EpubBookRef.

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
bool disposing

true to release both managed and unmanaged resources; false to release only unmanaged resources. This class has no unmanaged resources, so the value of false causes this method to not release any resources.

View Source

~EpubBookRef()

Finalizes an instance of the EpubBookRef class.

Declaration
protected ~EpubBookRef()
View Source

GetNavigation()

Processes the navigational information of the EPUB book and returns a list of its navigation elements (typically the table of contents).

Declaration
public List<EpubNavigationItemRef>? GetNavigation()
Returns
Type Description
List<EpubNavigationItemRef>

A list of navigation elements of the book or null if the book doesn't have navigation information.

View Source

GetNavigationAsync()

Asynchronously processes the navigational information of the EPUB book and returns a list of its navigation elements (typically the table of contents).

Declaration
public Task<List<EpubNavigationItemRef>?> GetNavigationAsync()
Returns
Type Description
Task<List<EpubNavigationItemRef>>

A task that represents the asynchronous processing operation. The value of the TResult parameter contains a list of navigation elements of the book or null if the book doesn't have navigation information.

View Source

GetReadingOrder()

Processes the reading order of the EPUB book and returns a list of text content file references in the order of reading intended by the author.

Declaration
public List<EpubLocalTextContentFileRef> GetReadingOrder()
Returns
Type Description
List<EpubLocalTextContentFileRef>

A list of text content file references in the order of reading.

View Source

GetReadingOrderAsync()

Asynchronously processes the reading order of the EPUB book and returns a list of text content file references in the order of reading intended by the author.

Declaration
public Task<List<EpubLocalTextContentFileRef>> GetReadingOrderAsync()
Returns
Type Description
Task<List<EpubLocalTextContentFileRef>>

A task that represents the asynchronous processing operation. The value of the TResult parameter contains a list of text content file references in the order of reading.

View Source

ReadCover()

Loads the book's cover image from the EPUB file.

Declaration
public byte[]? ReadCover()
Returns
Type Description
byte[]

Book's cover image or null if there is no cover.

View Source

ReadCoverAsync()

Asynchronously loads the book's cover image from the EPUB file.

Declaration
public Task<byte[]?> ReadCoverAsync()
Returns
Type Description
Task<byte[]>

A task that represents the asynchronous load operation. The value of the TResult parameter contains the book's cover image or null if there is no cover.

Implements

IDisposable
  • View Source
In this article
Back to top Generated by DocFX