Answers.Body: <p>The easiest way is to use an ePub editor.</p>
  
  <p>One have have used is <a href="https://github.com/user-none/Sigil">Sigil</a> 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.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-12-19T11:15:19.027Z
Answers.LastActivityDate: 2013-12-19T11:36:08.403Z
Answers.LastEditDate: 2013-12-19T11:36:08.403Z
Answers.UserDisplayName: mmmmmm
Answers.Body: <p>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".</p>
  
  <p>If you have Calibre installed, but do not use it to manage your books, you can start the editor from the commandline with:</p>
  
  <pre><code>ebook-edit /path/to/your.ebook
  </code></pre>
  
  <p>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 <code>page-break-*</code> styles associated with an element, and seem to be enforced through splitting of the HTML within different <code>.html</code> files of the <code>.epub</code> as well. </p>
  
  <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-24T10:24:49.880Z
Answers.Text: 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.
Answers.UserDisplayName: gavenkoa
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-06T06:40:57.310Z
Answers.LastActivityDate: 2014-03-13T19:14:48.303Z
Answers.LastEditDate: 2014-03-13T19:14:48.303Z
Answers.UserDisplayName: Anthon
Body: <p>I have an eBook in <code>.epub</code> file format and I would like to remove the entire first and last pages of the book. How would I go about doing this?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-07-16T11:56:52.837Z
Comments.Text: 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.
Comments.UserDisplayName: shevy
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-12-19T11:57:23.050Z
Comments.Text: This question appears to be off-topic because it is about activity of questionable legality.
Comments.UserDisplayName: James Jenkins
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-12-19T14:52:50.527Z
Comments.Text: @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](http://ebooks.stackexchange.com/questions/9/clean-up-converted-ebook).
Comments.UserDisplayName: fuxia
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-12-23T10:55:47.607Z
Comments.Text: This sort of discussion should be on meta. See:  http://meta.ebooks.stackexchange.com/questions/73/query-on-closing-a-question-as-off-topic
Comments.UserDisplayName: mmmmmm
Tags: <epub><editing>
Title: How do I remove pages from an ePub file?
UserDisplayName: shea
ThreadText: # How do I remove pages from an ePub file?
  
  (Asked by: username_0 on 2013-12-19)
  
  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?
  
  **Tags:** epub, editing
  
  > **Comments:**
  > **username_2**: This question appears to be off-topic because it is about activity of questionable legality.  
  > **username_3**: @username_2 _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](http://ebooks.stackexchange.com/questions/9/clean-up-converted-ebook).  
  > **username_4**: This sort of discussion should be on meta. See:  http://meta.ebooks.stackexchange.com/questions/73/query-on-closing-a-question-as-off-topic  
  > **username_1**: Of course the question itself is not off-topic at all. But more importantly, I would highly recommend to disallow statements such as from username_2 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.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_5 on 2014-03-06. Score: 19 | Accepted answer
  
  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.
  
  > **Comments:**
  > **username_6**: 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.  
  
  ---
  
  ### Answer by username_4 on 2013-12-19. Score: 14
  
  The easiest way is to use an ePub editor.
  
  One have have used is [Sigil](https://github.com/user-none/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.
  
  
  ---
  
  