Analysis of Epub-format e-books: Document Composition

Source: Internet
Author: User

After decompression, you can use the decompression software (such as WinRAR and WinZip) to browse or decompress the package. An unencrypted Epub e-book consists of three parts. The file structure is shown in:

 

1. File: mimetype

Each Epub e-Book contains a file named mimetype with the same content, which is used to describe the file format of Epub. The file content is as follows:

 

Application/Epub + Zip // annotation, indicating that you can use Epub and zip tools to open

 

 

2, directory: META-INF

According to the OCF specification, the META-INF is used to store container information. By default (encryption), the directory contains a file, namely, container. XML, with the following content:

 

<? XML version = '1. 0' encoding = 'utf-8'?> <Container xmlns = "urn: Oasis: names: TC: OpenDocument: xmlns: container" version = "1.0"> <rootfiles> <rootfile full-Path = "oebps/content. OPF "media-type =" application/oebps-package + XML "/> </rootfiles> </container>

 

Container. the main function of XML is to tell the reader that the path (red) of the root file of the e-book is open. Generally, the container. the XML file does not need to be modified unless you change the path and name of the root file.

In addition to the container. xml file, OCF also specifies the following files:

(1) [manifest. XML], file list (2) [metadata. XML], metadata (3) [signatures. XML], digital signature (4) [encryption. XML], encryption (5) [rights. XML], permission management for Epub ebook, these files are optional.

 

3. Directory: oebps

The oebps directory is used to store ops documents, OPF documents, CSS documents, and NCX documents. If you are creating a Chinese ebook, The oebps directory also includes TTF documents (I .e. font documents ), you can also create sub-directories in the oebps directory, such as creating the chapter directory and storing the ops documents of each chapter in the chapter directory. Example of an Epub ebook oebps document:

 

 

The content. OPF file and TOC. NCX file are required. Other files can be determined based on the actual situation of the ebook.

For the content. OPF file, see the OPF Analysis in the blog.

For more information about the TOC. NCX file, see section toc. NCX.

 

Original article address

 

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.