The “DAISY 2.02 to EPUB 3” script will convert a DAISY 2.02 DTB (Digital Talking Book) into an EPUB 3 publication.This page describes the steps, comments and issues related to this transformation.
Table of contents
- DAISY 2.02 To EPUB 3
- Table of contents
- Synopsis
- Inputs
- Outputs
- Options
- Example running from command line
- Outline
- Errors
- See Also
- Main Specifications
- Related Specifications
Synopsis
Inputs
NCC
Media-type:
- application/xhtml+xml
- text/html
Sequence: no
Outputs
EPUB 3
Options
Include Media Overlay
Whether or not to include media overlays and associated audio files.
See AlsoHow to download a DAISY book to your computer | CELADownload and Installation - The DAISY ConsortiumPossible values:
true
orfalse
Default value:
true
Backwards compatible
Whether or not to include NCX-file, OPF guide element and backwards-compatible metadata.
Possible values:
true
orfalse
Default value:
true
EPUB 3 file name
By default, the file name is the dc:identifier with a ".epub" file extension.
By default, the file name is the dc:identifier with a ".epub" file extension.
This option can be used to set a custom file name.
Possible values: Any <string>
Default value:
Usage: dp2 [GLOBAL_OPTIONS] daisy202-to-epub3 [OPTIONS]Options:
--source source | |
--mediaoverlay [mediaoverlay] | Include Media Overlay (default: true ) |
--compatibility-mode [compatibility-mode] | Backwards compatible (default: true ) |
--epub-filename [epub-filename] | EPUB 3 file name (default: ) |
-o,--output [OUTPUT] | Path where to store the results. This option is mandatory when the job is not executed in the background |
-z,--zip | Write the output to a zip file rather than to a folder |
-n,--nicename [NICENAME] | Set job's nice name |
-r,--priority [PRIORITY] | Set job's priority (high|medium|low) |
-q,--quiet | Do not print the job's messages |
-p,--persistent | Delete the job after it is executed |
-b,--background | Sends the job and exits |
Example running from command line
On Linux and Mac OS X:
$ cli/dp2 daisy202-to-epub3 --x-href samples/daisy202/dontworrybehappy/ncc.html --x-output ~/Desktop/out --x-mediaoverlay false --x-compatibility-mode false
On Windows:
$ cli\dp2.exe daisy202-to-epub3 --x-href samples\daisy202\dontworrybehappy\ncc.html --x-output C:\Pipeline2-Output --x-mediaoverlay false --x-compatibility-mode false
This command will create two entries in the output directory. One is a folder called “epub”, which is a temporary directory created by the converter. The second is the resulting EPUB 3 file. The EPUB 3 file is given a name based on the dc:identifier and dc:title metadata elements from the original NCC; “dc:identifier - dc:title.epub”.
Outline
The high-level conversion workflow is as follows:
- Get the SMIL-based reading order from the NCC
- Load all the SMILs and upgrade them to EPUB 3 Media Overlays
- Extract content document references from each SMIL
- Make a content-based reading order
- Load all the content documents, upgrade them to EPUB 3 Content Documents
- If mediaoverlay = ‘true’
- Rearrange the Media Overlays to match the Content Documents
- Get all referenced audio, images, etc.
- Make the EPUB 3 Navigation Document based on the NCC
- Make the EPUB 3 Package Document
- Store the EPUB 3 Publication in a OCF ZIP Container
Errors
This is a list of defined errors for this script. Each error has a unique error code for easy identification.
PDE01
: href must be a valid URI. In practice this simply means that the path must be prefixed with “file://”, and in Windows, all directory separators () must be replaced with forward slashes (/).PDE02
: output must be a valid URI. In practice this simply means that the path must be prefixed with “file://”, and in Windows, all directory separators () must be replaced with forward slashes (/).PDE03
: When given, mediaoverlay must be either “true” (default) or “false”.PDE04
: When given, compatibility-mode must be either “true” (default) or “false”.