How can I easily extract some sections from an ebook and create a new one that will contain just those parts? It would be especially useful with omnibus ebooks when I want to read just some of the included novels.
Besides using a real ebook editor like Sigil, there is an easier way to do it.
Calibre has a very useful additional plugin called EpubSplit, that with a simple interface let's you select the single
.html files inside the
.epub and create a new ebook just from them; after the process is also possible to edit the metadata of the newly created ebook.
These tools only work with
.epub files, to perform this kind of editing on other formats a conversion with Calibre should be made.
Assuming that new chapters/sections begin on a new page:
For a PDF files:
pdftk in.pdf cat 1 2 5-8 output out.pdf
gives you page 1,2,5,6,7,8.
For a DjVu file, for each page with number N do:
djvused in.djvu -e "select N; save-page-with part-N.pdf"
and then combine with:
djvm part-*.djvu out.djvu
assuming you have padded N with leading zeros to the widht of the largest page number, otherwise the sorting of the
part-N.djvu files will not be same order as in the original file.