18

I have an eBook in .epub file format and I would like to remove the entire first and last pages of the book. How would I go about doing this?

  • 5
    This question appears to be off-topic because it is about activity of questionable legality. – James Jenkins Dec 19 '13 at 11:57
  • 4
    @JamesJenkins In dubio pro reo. Free ebooks have ads sometimes too. This is one common way the make money from them. Bungeshea, you can use the method described in Clean up converted ebook. – fuxia Dec 19 '13 at 14:52
  • 2
    This sort of discussion should be on meta. See: meta.ebooks.stackexchange.com/questions/73/… – Mark Dec 23 '13 at 10:55
17

Calibre has had a book editing feature, since version 1.15. If you manage your ebooks in Calibre, just right-click on the book and select "Edit Book".

If you have Calibre installed, but do not use it to manage your books, you can start the editor from the commandline with:

ebook-edit /path/to/your.ebook

One thing you should note however is that in an EPUB file a "page" depends on the rendering device, the font etc. A page-break can be "inserted", through page-break-* styles associated with an element, and seem to be enforced through splitting of the HTML within different .html files of the .epub as well.

If a section of HTML contains enough text to require rending in multiple pages, it is difficult to speak about something like "removing the first page", as what is exactly contained on the first page is not constant even if the EPUB doesn't change.

  • Great answer! It helped me to understand if there are pages in ePub. It appears that ePub has page breaks but not pages itself. Pages exist only in rendering software not in format itself. – gavenkoa Sep 24 '18 at 10:24
13

The easiest way is to use an ePub editor.

One have have used is Sigil which is free. This allows you to edit the data in the book which is in the HTML format and also control what XHTML pages are in the book. I would guess that the adverts are on separate XHTML pages to the rest and so you only need to edit the contents.

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.