# EPUB splitting and merging examples, version 2.0.0

Three original, small EPUB inputs and three recorded free-tool outputs. Use
them to see the difference between extracting a chapter range, splitting into
individual chapters, and joining books in a chosen order. They are CC0; no
account, payment or attribution link is needed to download or reuse them.

These are worked examples, not a representative ebook benchmark. They contain
original prose, a stylesheet, navigation and a simple SVG route diagram.
The results do not establish typical speed, compression savings, accessibility,
appearance in every reader or acceptance by a bookstore.

## Extract chapters 2 and 3 as one EPUB

1. Open https://epublys.com/split_epub and select `four-chapters.epub`.
2. Set **From chapter** to `2` and **To chapter** to `3`.
3. Leave **Keep original metadata** enabled, then run the splitter.

The input is *The Map Room*: The Door, The Desk, The Window, The Return.
The result is one EPUB containing **2. The Desk** and **3. The Window**, in that
order. Its title remains *The Map Room*. The website names its result after
the selected input; the recorded download here is named `range-2-3-free.epub`.

Chapter numbers refer to the book's ordered chapter documents, not printed
page numbers or headings inside one document. A real book may package several
headings into one document. Check the chapter list after selecting your file.

## Get one EPUB per chapter

Select the same `four-chapters.epub`, leave both range fields empty, and run
the splitter. The result is a ZIP containing four chapter EPUBs. The browser
offers the complete ZIP and individual chapter downloads. `chapters-free.zip`
is the recorded ZIP. Its inner files retain the input name plus chapter number;
their book titles are *The Map Room - Part 1* through *Part 4*.

## Merge two volumes in order

This version records the corrected merger. The three original inputs and every
individual EPUB in the three recorded workflows passed EPUBCheck 5.4.0 without
diagnostics in the dated local measurement, for both free and Pro settings.
The generated contents document remains available to a reader's table-of-contents
interface. It joins the reading-order spine as non-linear content only when
preserved source content links to it. This avoids the unreachable non-linear
navigation error in the version 1 recording while retaining working contents
back-links. These small examples do not establish that arbitrary uploaded books
will pass EPUBCheck. Check your returned book before publishing.

1. Open https://epublys.com/merge_epub and select `volume-one.epub`, then
   `volume-two.epub`.
2. Keep Volume One above Volume Two. Drag rows or use their move-up/move-down
   buttons to change the order.
3. Enter **Field Notes Collection** as the custom title, leave Author blank,
   and turn **Chapter dividers** off for this example. The normal default is on.
4. Merge and download the result. `merged-free.epub` is the recording.

The source chapter order is Volume One: Arrival, Volume One: The Garden,
Volume Two: The Path, Volume Two: Departure. The combined navigation includes
both volumes. The generated navigation document is separate from these four
source chapters. Leaving Author blank retains the source author names; a custom
author would replace them. This example does not demonstrate removal of DRM.

## Free and Pro differences

The published outputs were generated with the free setting: they include an
Epublys colophon and the publisher `Epublys (epublys.com)`. That publisher replaces
the original on split output even when **Keep original metadata** is enabled.
Pro output has no added colophon or Epublys publisher. The local measurement
also checked both Pro split modes and the Pro merge; those binaries are not
included as public downloads. Read `manifest.json` for the exact options and
observations, including metadata and chapter labels.

Downloads are separate from tool operations. Running the two split exercises
and the merge uses three successful operations under the website's normal free
allowance. Your remaining allowance, file limits and account tier still apply.
No live HTTP quota, account or entitlement check is implied by a local engine
recording. Files submitted to these web tools upload over HTTPS for processing;
see https://epublys.com/privacy for the handling and cookie details.

## Check or reproduce the collection

`SHA256SUMS.txt` covers the other published downloads, including `source.zip`.
Run `sha256sum -c SHA256SUMS.txt` in a directory containing those downloads.
`manifest.json` records input hashes, output hashes, engine source hashes,
options and the actual EPUBCheck 5.4.0 results. The reference checker is separate
from Epublys's structural checks; neither is a guarantee of store acceptance.

The source ZIP contains the original-input builder, package metadata, this
documentation, immutable free-output recordings and their observations. It
does not contain Epublys product engines, EPUBCheck or JSZip. Extract it into
an empty directory and use Node.js 22 or later:

    npm install --ignore-scripts
    node build.mjs --out dist
    node build.mjs --out dist --check

JSZip 3.10.2 is the only dependency. The builder recreates the original inputs
with fixed archive metadata, then packages the recorded outputs unchanged.
It does not rerun the engines or checker. Tool-generated identifiers and
modification times vary on another tool run, so a fresh browser result need not
have the recording's binary hash. Compare chapters, order, navigation and
branding instead. Rebuilding this public kit from its included recordings is
deterministic; generating fresh engine outputs is a separate measurement.

To repeat a reference check, obtain the official EPUBCheck 5.4.0 distribution:
https://github.com/w3c/epubcheck/releases/tag/v5.4.0

    java -jar /path/to/epubcheck.jar range-2-3-free.epub --failonwarnings

Unzip `chapters-free.zip` and check each inner EPUB separately; the outer ZIP
is a download bundle, not an EPUB. The manifest records the verified reference
distribution and JAR hashes. The repository-only measurement command is in
`scripts/workflow-samples/v2/verify.mjs`, outside this public source package.


## Additional navigation regression measurements

The repository-only probe also checks the default divider setting, reversed input
order, a valid EPUB 2 input whose chapter navigation comes from NCX, a valid
EPUB 3 input whose chapter links back to its in-spine contents document, an
external hyperlink containing parent-directory segments, and extracting chapters
2–3 from a freshly merged book. It tests free and Pro settings and runs full
EPUBCheck on each variant. These variant binaries are not public downloads.
Their options, semantic inspections and checker results are recorded under
`regressions` in `manifest.json`.

**Separate EPUB 2 conversion limitation:** the valid EPUB 2 source has XHTML 1.1
DOCTYPE declarations. When merged into an EPUB 3 package, those declarations
are retained. EPUBCheck reports `HTM-004` on both copied source chapter files,
in both the free and Pro variant. The source input passes EPUBCheck. The variant
retains chapter navigation and contains neither `OPF-096` nor `RSC-011`, but it
is not an EPUBCheck pass. The exact diagnostics and source hashes appear in the
manifest. The navigation correction does not resolve this separate conversion
limitation. The three public workflow recordings use the original EPUB 3 inputs
and pass without diagnostics; this is not a blanket claim for EPUB 2 inputs.

Version 1 remains available at https://epublys.com/samples/workflows/v1/README.md
with its historical recordings and disclosed checker failure. Version 2 follows
the earlier version 1 recording on 2026-10-20 (UTC) and uses the same original
input bytes, so the exercises can be compared directly.
