Tools, FAQ, Tutorials:
Hello-3.1.epub - Package File: package.opf
How to create a package file like package.opf for an EPUB 3.1 book?
✍: FYIcenter.com
At least one package file, like package.opf, is required for
an EPUB 3.1 book in the book ZIP container.
It defines required meta data and specifies 2 required content files.
Here is the requirement on a package file:
1. A package file must be named with .opf file extension.
2. A package file must be an XML file and meet the EPUB Packages 3.1 specifications.
3. A package file must specify version="3.0" in the "package" XML element.
4. A package file must specify a unique-identifier and several meta data elements. For example:
<dc:title>Hello</dc:title>
<dc:identifier id="id">fyicenter.com.epub.hello</dc:identifier>
<dc:language>en-US</dc:language>
<meta property="dcterms:modified">2018-04-01T00:00:00Z</meta>
5. A package file must specify at least 2 XHTML files: one provides navigation information of the book, and the other provides the content of the book.
6. A package file can be placed in any directory of the EPUB 3.1 book ZIP container. But its exact location must be specified correctly in the "container.xml" file.
You can create a package file with any text editor. Here is an example called package.opf:
<?xml version="1.0" encoding="UTF-8"?>
<!-- package.opf
Copyright (c) FYIcenter.com
-->
<package xmlns="http://www.idpf.org/2007/opf" version="3.0"
unique-identifier="id">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/">
<dc:title>Hello</dc:title>
<dc:identifier id="id">fyicenter.com.epub.hello</dc:identifier>
<dc:language>en-US</dc:language>
<meta property="dcterms:modified">2018-04-01T00:00:00Z</meta>
</metadata>
<manifest>
<item id="navigation" href="/navigation.xhtml"
media-type="application/xhtml+xml" properties="nav"/>
<item id="content" href="/content.xhtml" media-type="application/xhtml+xml"/>
</manifest>
<spine>
<itemref idref="content"/>
</spine>
</package>
Download Hello-3.1.epub, and unzip it. You see an example of "package.opf" in the root directory.
⇒ Hello-3.1.epub - Navigation File: navigation.xhtml
⇐ Hello-3.1.epub - "container.xml" File
2022-05-31, ∼2383🔥, 0💬
Popular Posts:
How to use "{{...}}" Liquid Codes in "set-body" Policy Statement? The "{{...}}" Liquid Codes in "set...
How to decode the id_token value received from Google OpenID Connect authentication response? Accord...
How To Read a File in Binary Mode in PHP? If you have a file that stores binary data, like an execut...
Can Multiple Paragraphs Be Included in a List Item? Yes. You can include multiple paragraphs in a si...
FYIcenter JSON Validator and Formatter is an online tool that checks for syntax errors of JSON text ...