Usage of this library is very easy.

Ebup class
This class allows us to create epub from local directory.

Epub sample code

Epub epub = new Epub("c:\\epub\\", TocOptions.ByFilename);
epub.Metadata.Creator = "BkSlim";
epub.Metadata.Language = "ua";
epub.Metadata.Title = "TestBook";
epub.Metadata.Date = DateTime.Now.ToShortDateString();
epub.Structure.Directories.ImageFolder = "Image";
epub.Structure.Directories.CssFolder = "Css";
epub.DirectorySearchOption = SearchOption.AllDirectories;

TocOptions is enum with 2 options:
  1. ByFilename - Book table of content will be based on html filename
  2. ByTitleTag - Set content item title from html tag <title>
Default is ByFilename

You can change the structure of Epub file by changing Structure property.
Also, you should set book Metadata before building book.

SearchOption - allows us to control book content directory scanning (In depth or just top level).

Finally, build book with BuildToFile(),BuildToStream() or BuildToBytes().

Last edited Apr 21, 2011 at 11:15 AM by bkslim, version 1


No comments yet.