EPUB2 Basic Knowledge Introduction

Source: Internet
Author: User

First, what is epub

Epub is a fully open and free ebook standard. It can "automatically rearrange" the content.

epub File suffix name:. epub

II. epub composition

The Epub internally uses XHTML (or Dtbook) to present the contents of the file, defines the format and layout with a series of CSS, and compresses all the files into a zip package.

The EPUB format contains DRM-related features (currently the Epub engine does not consider DRM-related information)

Epub includes three key specifications:

Open publishing structure (open Publication structure,ops) 2.0, to define the content of the layout;

Open Package Format (Open Packaging Format,opf) 2.0, defines an XML-based. epub file structure, OEBPS accommodating format (OEBPS Container format, OCF) 1.0, collect all relevant files into a ZIP archive.

1. OPS:

Use XHTML (or Dtbook) to build the content of the book.

Use a series of CSS to define the format and layout of the book.

PNG, JPEG, GIF, SVG image formats are supported.

2. OPF:

The OPF file is the most complex meta-data in the EPUB specification. It is used to define the mechanism by which an OPS series of content is grouped together and provides some additional structure and content for ebook. The OPF contains four sub-elements: metadata, manifest, spine, guide. The Opf in oebps contains two xml:. Opf and. Ncx

(a). Opf

The OPF includes the following elements:

1) metadata:epub meta data, such as title, language, identifier, cover, etc. Of these, both the title and identifier data are required.

According to the EPUB specification, identifier is defined by the creator of the digital book and must be unique. For book publishers, this field typically includes the ISBN or Library of Congress numbers, or a URL or a randomly generated unique user ID. Note: Unique-identifier the value must and Dc:identifier the ID of the element property matches.

2) Manifest: Lists all the files contained in the package (XHTML, CSS, PNG, NCX, etc.). EPUB encourages the use of CSS to set the style of book content, so manifest also contains CSS. Note: All files that enter a digital book must be listed in manifest .

3) Spine: Linear reading order for all XHTML documents. Where Spine's TOC attribute must be included in the Manifest column. NCX ID. The OPF spine can be understood as the order of "pages" in the book, and the parsing is read spine from top to bottom in document order.

Each itemref element in spine needs to have a IDREF attribute that matches an ID in manifest.

The linear property in spine indicates whether the item is an item in linear reading order, or is not related to precedence. Some readers can handle linear=no items in spine as auxiliary options, and some readers choose to ignore this property. For example, in the following instance, a reader that supports the processing of accessibility options lists Titlepage, Chapter01, Chapter05,chapter02, Chapter03, and Chapter04 only after a click (or other open action) is displayed.

However, for print-enabled readers, you need to ignore the properties of Linear=no to ensure that the contents of OPS are displayed most fully.

A good reader needs to provide two choices to the user at the same time.

(b). Ncx

NCX defines a catalog table for digital books. In a complex book, a table of contents typically uses hierarchies, including nested content, chapters, and sections. Contains the TOC (Tablet of content, which provides some information on fragmentation).

The NCX

    • UID: The unique ID of a digital book. The element should correspond to the Dc:identifier in the OPF file.
    • Depth: reflects the depth of the hierarchy in the table of contents.
    • Totalpagecount and Maxpagenumber: only for paper books, keep 0 .

The content of Doctitle/text is the title of the book, which matches the dc:title in the OPF.

Navmap is the most important part of the NCX file, which defines the catalog of books. Navmap contains one or more navpoint elements, and each navpoint contains the following elements:

    • Playorder: Describes the reading order of the document. And the ITEMREF elements in the OPF spine are in the same order.
    • Navlabel/text: Gives the title of the chapter. It is usually the title or number of the chapter.
    • Content: its SRC attribute points to the physical resource that contains the content. Is the file declared in the OPF manifest.
    • You can also have one or more navpoint elements. NCX using nested navigation points to represent a hierarchy of documents

(c) NCX and OPF Spine What's the difference?

Both are easy to confuse because two files describe the order and content of the document. The simplest way to illustrate the difference between the two is to take a print book analogy: OPF Spine describes how the chapters in the book are actually connected, for example, by flipping through the last page of chapter one and seeing the first page of Chapter two. NCX describes the catalogue at the beginning of the book, which will certainly contain the main chapters of the book, but may also contain subsections that do not have separate pagination.

One rule is that NCX contains navpoint elements that are usually more than itemref elements in the OPF spine. In fact, all items in spine appear in NCX, but NCX may be more detailed.

3. OCF:

OCF defines how a file is packaged as a zip and has two additional information:

1) mimetype file in ASCII format. The file must contain a application/epub+zip string and be the first file in the ZIP archive. MimeType requires a non-compressed format.

2) a folder named Meta-inf. This folder needs to contain the Container.xml file.

4. Drm--need to include Rights.xml in the Meta-inf folder

To summarize, an epub ebook zip contains the following things:

1, mimetype file, must be the first file of the compressed package. Note that the mimetype must be in a non-compressed format.

2, Meta-inf directory, contains at least one container.xml file.

3, oebps directory (can be another name, but suggested with this name), contains:

A) the image subdirectory (not necessarily always) holds all the picture files

b) Content.opf file name can be other, the extension must be Opf, is an XML format within the package file list

c) Toc.ncx directory file, a "logical directory", browse the control file.

d) Some XHTML or HTML files. Is the content of the book.

Directory and file structure for simple EPUB archives:

MimeType
meta-inf/
Container.xml
oebps/
Content.opf
Title.html
Content.html
Stylesheet.css
Toc.ncx
images/

Cover.png

Third, Epub e-book Access website

Feedbooks:http://www.feedbooks.com/books/top?range=month

Palm Book Court: Http://www.cnepub.com/index

Coay:http://www.coay.com

Bo Cool network: Http://www.pockoo.com/books/?format=EPUB&orderby=lastedit

Sina ipad Digital Resources http://myphoto.tech.sina.com.cn/forumdisplay.php?fid=398

Epubbooks:http://www.epubbooks.com/books

Iv. Epub e-Book Reader (compare software)

Adobe Digital edition:http://www.adobe.com/products/digitaleditions/

Calibre: Open source e-Book management tool, supporting Windows, Linux, OSX and other platforms. can also be converted between various formats. http://calibre-ebook.com/

The EPUB reader on the aldiko:android. http://www.aldiko.com/

v. Epub e-book editing software

Epubbuilder:epubbuilder is a Chinese self-made software, hand-made when it is very easy to use, especially in each chapter of the production and directory, more convenient, but also provides the ability to import chm,txt,html files, more humane

Ecub:http://www.juliansmart.com/ecub

L Calibre

L Adobe InDesign

L Stanza

L Openberg Rector

L EPUB Check Tool

L Convert uploads to EPUB

L WEB2FB2

L Python Converter

L DAISY Pipeline

VI. Create an EPUB file

Reference: http://www.ibm.com/developerworks/cn/xml/tutorials/x-epubtut/section3.html

1. First build an empty zip file, you can take any name, preferably with the same name as your book.

2 , copy mimetype file into the package, note the so-called copy, that is, this file does not use compression mode.

3 , add other directories and files to zip in compression mode package.

4 , change to. epub File extension
OK
! An epub ebook is made.

vii. the complete epub Specification

OPF Specification: http://www.idpf.org/2007/opf/OPF_2.0_final_spec.html

OPS specification: http://www.idpf.org/2007/ops/OPS_2.0_final_spec.html

oebps Specification: http://www.idpf.org/ocf/ocf1.0/download/ocf10.htm

EPUB2 Basic Knowledge Introduction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.