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?
-
5This question appears to be off-topic because it is about activity of questionable legality.– James JenkinsCommented Dec 19, 2013 at 11:57
-
6@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.– fuxiaCommented Dec 19, 2013 at 14:52
-
2This sort of discussion should be on meta. See: meta.ebooks.stackexchange.com/questions/73/…– mmmmmmCommented Dec 23, 2013 at 10:55
-
Of course the question itself is not off-topic at all. But more importantly, I would highly recommend to disallow statements such as from James Jenkins because (a) it is an assumption, and (b) more importantly it does not answer the original question. People can have gazillion of different legitimate reasons - they don't need to explain that background on StackOverflow, so statements like this should not be upvoted or allowed, since it distracts. I came here precisely to remove pages. My use case is that I work through these books page after page and discard what I know already.– shevyCommented Jul 16, 2020 at 11:56
2 Answers
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.– gavenkoaCommented Sep 24, 2018 at 10:24
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.