3

Some Microsoft books, and O'Reilly as well, are on the excessive side. Starting from PDF, calibre can conver to epub easily. Or, some are available as epub and even mobi.

Dealing only with `epub' as the common denominator, the question is:

how to truncate an epub book into sub-books? Really, it should be multiple volumes and published as such. The question is, how to easily break an e-book into slices of 24 MB?

Manually transferring large files might be problematic -- not sure yet.

4

How can I split an epub book into sub-books?

Use the EpubMerge/Split Calibre plugins:

EpubSplit

This is a repository for the EpubSplit Calibre Plugin.

Most discussion of this plugin takes place in the EpubSplit Calibre Plugin forum.

Splitting omnibus eBooks into multiple eBooks seems to be a common request, but there haven't been many tools to do so without a lot of hand editing.

This plugin provides the ability to create new EPUBs by splitting off part of an existing (non-DRM) EPUB format eBook.

Main Features of EpubSplit Plugin:

  • Present the user with a list of 'split lines' in the existing EPUB. The beginning of each file listed in the manifest spine and each Table of Contents(TOC) entry. tagged files are also indicated.
  • 'Preview' contents of each 'split line' as a tooltip over the HREF.
  • Allow user to edit the TOC entry(s) for each 'line'.
  • Select one or more of the offered lines to include in the new eBook,
  • Edit the metadata for the new split eBook, and then,
  • Extract only the selected contents of the source EPUB into the new EPUB,
  • Scan the selected content for CSS & image links for additional files to include,
  • Scan the selected content for internal links and anchors and update links that need to point to different filenames,
  • Use the metadata entered into calibre for the new eBook (including cover) as the metadata in the new EPUB.
  • Return to list of source EPUB sections after creating a new split EPUB.
  • Configure which metadata from source EPUB to copy to new eBook, now offering more of the standard metadata and custom columns.
  • Configurably populate a custom column with the source book title/author/etc.
  • CLI via calibre-debug --run-plugin

Source EpubSplit/README.md at master · JimmXinu/EpubSplit

Installing and Configuring the Plugins

enter image description here

The heart of our workflow here, Calibre itself aside, is a pair of plugins contributed to the Calibre plugin database by JimmXinu. In order to use the plugins, we need to first install them. Within Calibre, navigate to the plugin menu by clicking Preferences ->Get plugins to enhance calibre, as seen in the screenshot above.

The User Plugins menu is, by default, sorted by the date the plugin was added to/updated in the database. Click on the Plugin Name column to sort by name and make locating our two plugins easier. Once sorted by name, scroll down until you find EpubMerge and EpubSplit, like so:

enter image description here

Select one and then click the Install button. Click Yes when the security risk dialog box pops up. In the next step, the plugin installer will ask where you want links to the plugin to appear. By default, it will add a button to your main toolbar. Because we tend to work frequently from the context menu, we also added a context menu entry:

enter image description here

As noted at the bottom of the window, you can always go into Preferences -> Customize the toolbar to change these settings later. Once you’ve made your selection and hit OK here, it will remind you that the changes won’t take effect until you restart Calibre.

Click OK instead of Restart as we need to install the second plugin. Repeat the exact same process for the second plugin. Double check that both EpubMerge and EpubSplit are installed. Restart Calibre.

enter image description here

After you’ve restarted Calibre, either right click to access your context menu or navigate to the main menu bar. EpubMerge has a few basic configuration options, whereas EpubSplit is configuration free. When you select Configure Plugin under EpubMerge, you’ll see the following options:

enter image description here

This is the default configuration and, unless you have a pressing reason to do otherwise, we suggest leaving as it is. Preserving the Metadata makes it extremely easy to precisely reverse the merge at a later date if you need to return the documents to their original state.

Splitting Your Ebooks

When it comes time to split your ebooks, there is the ultra-super-easy way and the slightly trickier way. If you are splitting a book that you previously merged with EpubMerge (and you had the “Keep Unmerge Metadata” box checked in the plugin options), then it’s a snap to split the mega volume apart.

enter image description here

In the case of our massive Jane Austen anthology, all we had to do to turn the mega volume back into the individual books was to right click on it and select EpubMerge -> UnMerge Epub. Afterwards, the plugin created a new entry for each distinct book, dumped the old metadata back into it, and placed the individual novel as an ePub in the directory. Thanks to the preserved metadata, it’s that easy.

RELATED: How To Use Calibre To Correctly Order Your Ebook Series

If you’re splitting a document that does not have the metadata preserved by the EpubMerge plugin (either because you have the feature turned off or the document wasn’t created by the plugin in the first place) you’ll need to get your hands a little dirtier. Let’s take a look at our Jane Austen anthology using the EpubSplit plugin. After selecting the anthology and clicking EpubSplit, we’re presented with a fairly messy look at the guts of the ePub:

enter image description here

There is no automatic way to split a document that isn’t tagged with the helpful unmerge data placed by the EpubMerge plugin, so we’ll have to do this by hand. In the case of this already merged anthology, we have two sets of information we can go off to guide our split. First, each separate document that was originally merged into the mega volume has a unique number identifier found in the HREF column (in the case of the first novel, Sense and Sensibility, every file belonging to that novel is tagged with the number 9781411433144).

Alternatively, if we were working with a document that did not have clean demarcation via serial number between the different sections, we could look at the Table of Contents column to see where each portion (as marked via the ePubs table of contents structure) started and stopped. We could further confirm these points in the text by hovering over the list entry to preview a portion of the first page.

Either way, once we establish what we wanted to manually extract from the ePub, we then highlight just those entries and click New Book. You will receive a warning, just like you did with the Merge function, that indicates a new entry has been created in Calibre but will not be populated until you review the metadata:

enter image description here

Also like the merge process, the metadata is pulled from the original document (in this case, the anthology) and applied to the extracted document. In the absence of preserved metadata, you have to enter it manually (or use Calibre’s metadata scraping function) to properly populate the new documents metadata.

Let’s take a peek at our freshly extracted book:

enter image description here

The table of contents has survived the extraction process, as well as the formatting of the novel. Another success!

Source How to Easily Merge and Split Ebooks

Source

  • 1
    LOL, easy? gotta respect that answer, thanks. I want to hit a "slice and dice" button or command. Let me leave it open a bit on offchance someone wanders by with magic. – Thufir Jul 8 '18 at 10:13
1

If you have Calibre (and you should if you’re dealing with e-books), the above answer is probably still the easiest way to do it. The answer tries to meet all possibilities, so it’s a little wordy. One possible issue is that if the segments or chapters aren’t named in a helpful way it might be hard to tell what they are when you’re choosing what to include.

Other options

  1. Unzip it! An epub file is just a bunch of HTML, CSS, images (& maybe fonts) in a zip file. You could extract it to a folder and just remove the (.xhtml) files you don’t want, then zip up the structure and rename to .epub.
  2. Use an editor. You could use an epub editor. Calibre comes with its own editor. Once it’s installed you should have an Open with E-book Editor option in your right-click menu in your file manager AND Edit book from Calibre’s right-click menu. Sigil is another excellent editor.

Either of these might require learning a little about the structure of epubs, but the advantage of an editor is that it will show you a preview so you can tell what you’re deleting.

In professional epubs the individual text files (.xhtml) will usually correspond to chapters. In an automatically converted file they might just be cut at an arbitrary size and have an unhelpful name.

You can get support for both programs (& their many plugins) at the Mobileread forums: Calibre | Sigil.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.