Answers.Body: <p>Assuming all files and only those files are in one directory.</p>
  
  <p>For PDF files:</p>
  
  <pre><code>pdftk *.pdf cat output ../combined.pdf
  </code></pre>
  
  <p>For DjVu:</p>
  
  <pre><code>djvm  -create *.djvu ../combined.djvu
  </code></pre>
  
  <p>Of course you would have to resolve metadata (author of a combined document) yourself.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-07T11:42:07.867Z
Answers.Text: Maybe a little more content here on where you would run this command?  Are you doing this on an ereader, Windows folder, Apple...?
Answers.UserDisplayName: James Jenkins
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-07T14:53:53.307Z
Answers.Text: @JamesJenkins that would best executed through a Linux terminal. A good reference: ["How do I install Pdftk on my server?"](http://stackoverflow.com/questions/3146766/how-do-i-install-pdftk-on-my-server) there is a graphical tool: [PDFtk Free](http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/)
Answers.UserDisplayName: DᴀʀᴛʜVᴀᴅᴇʀ
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-07T15:06:16.013Z
Answers.Text: @Gramps You can use it on Windows as well, and on [OSX](http://stackoverflow.com/questions/20804441/how-do-i-installing-pdftk-on-mac)
Answers.UserDisplayName: Holger
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-05T04:02:25.397Z
Answers.Text: Really like this strategy... I've been having a time trying to merge several hundred html files into a single epub. Calibre's `ebook-convert` lets me do this for a 1:1 conversion but doesn't seem to accept multiple input files. There is Calibre Merger Plugin but it appears to only work for graphical mode making it a no-go for scripting ~800 html pages into a single file... With this, I can programmatically convert html to pdf (via `ebook-convert`), merge multiple pdfs into one with the above, and then convert the final pdf back to epub with one more `ebook-convert` call.
Answers.UserDisplayName: zpangwin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-07T06:18:11.767Z
Answers.LastActivityDate: 2014-03-07T06:18:11.767Z
Answers.UserDisplayName: Anthon
Answers.Body: <p>You can use <strong>Calibre Merger Plugin</strong> , I think.</p>
  
  <p>For details, click to <a href="http://www.epubor.com/how-to-merge-multiple-epub-ebooks.html" rel="nofollow"><strong><em>how-to-merge-multiple-epub-ebooks</em></strong></a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-04-30T14:28:40.217Z
Answers.Text: Ideally you should summarize the steps in your answer (and leave the link). Link-only answers are generally frowned up (especially if the site is down or the link dies for whatever reason).
Answers.UserDisplayName: Jason Down
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-04-30T03:11:18.253Z
Answers.LastActivityDate: 2014-04-30T03:11:18.253Z
Answers.UserDisplayName: angel1989
Answers.Body: <p>Is it possible to use a full fledged editor like <a href="https://code.google.com/p/sigil/" rel="noreferrer">Sigil</a>. It works with <code>.epub</code> files, but if needed, before the editing, it's possible to use <a href="http://calibre-ebook.com/" rel="noreferrer">Calibre</a> to convert the source ebook into <code>.epub</code>, then reconvert it after the job. </p>
  
  <p>Anyway, for a faster and easier solution, Calibre has a very useful additional plugin called <a href="http://www.mobileread.com/forums/showthread.php?t=169744" rel="noreferrer">EpubMerge</a>, that, as the name imply, can merge multiple epubs into a single one, also letting create a new table of contents and edit all relevant metadata of the new output file, while leaving unaltered the source ones. Also in this case, if another ebook format is needed, a conversion is required after the editing since the plugin only works with <code>.epub</code> files.</p>
  
  <p><img src="https://i.sstatic.net/q61Wo.png" alt="enter image description here"></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-06T22:57:40.033Z
Answers.Text: So how is the TOC addressed then?
Answers.UserDisplayName: DᴀʀᴛʜVᴀᴅᴇʀ
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-28T09:08:55.807Z
Answers.Text: The TOC is created by merging the existing ones. Optionally, Calibre can also be used to customize it.
Answers.UserDisplayName: Sekhemty
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-05T03:55:17.387Z
Answers.Text: updated link for Sigil since code.google.com is long gone: [https://github.com/Sigil-Ebook/Sigil](https://github.com/Sigil-Ebook/Sigil). If you are on Linux, it might even already be in your central repos (It was for Fedora 35)
Answers.UserDisplayName: zpangwin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-06T22:26:43.410Z
Answers.LastActivityDate: 2014-03-06T22:26:43.410Z
Answers.UserDisplayName: Sekhemty
Body: <p>Is there a way to easily combine multiple ebooks into a single file, that will collect all of them?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-03-06T22:37:58.040Z
Comments.Text: Related: http://ebooks.stackexchange.com/q/1069/136
Comments.UserDisplayName: Sekhemty
Tags: <epub><calibre><editing><sigil>
Title: How can I merge multiple ebooks in a single file?
UserDisplayName: Sekhemty
ThreadText: # How can I merge multiple ebooks in a single file?
  
  (Asked by: username_0 on 2014-03-06)
  
  Is there a way to easily combine multiple ebooks into a single file, that will collect all of them?
  
  **Tags:** epub, calibre, editing, sigil
  
  > **Comments:**
  > **username_0**: Related: http://ebooks.stackexchange.com/q/1069/136  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_0 on 2014-03-06. Score: 9 | Accepted answer
  
  Is it possible to use a full fledged editor like [Sigil](https://code.google.com/p/sigil/). It works with `.epub` files, but if needed, before the editing, it's possible to use [Calibre](http://calibre-ebook.com/) to convert the source ebook into `.epub`, then reconvert it after the job.
  
  Anyway, for a faster and easier solution, Calibre has a very useful additional plugin called [EpubMerge](http://www.mobileread.com/forums/showthread.php?t=169744), that, as the name imply, can merge multiple epubs into a single one, also letting create a new table of contents and edit all relevant metadata of the new output file, while leaving unaltered the source ones. Also in this case, if another ebook format is needed, a conversion is required after the editing since the plugin only works with `.epub` files.
  
  ![enter image description here](https://i.sstatic.net/q61Wo.png)
  
  > **Comments:**
  > **username_3**: So how is the TOC addressed then?  
  > **username_0**: The TOC is created by merging the existing ones. Optionally, Calibre can also be used to customize it.  
  > **username_5**: updated link for Sigil since code.google.com is long gone: [https://github.com/Sigil-Ebook/Sigil](https://github.com/Sigil-Ebook/Sigil). If you are on Linux, it might even already be in your central repos (It was for Fedora 35)  
  
  ---
  
  ### Answer by username_1 on 2014-03-07. Score: 4
  
  Assuming all files and only those files are in one directory.
  
  For PDF files:
  
  ```
  pdftk *.pdf cat output ../combined.pdf
  
  ```
  
  For DjVu:
  
  ```
  djvm  -create *.djvu ../combined.djvu
  
  ```
  
  Of course you would have to resolve metadata (author of a combined document) yourself.
  
  > **Comments:**
  > **username_2**: Maybe a little more content here on where you would run this command?  Are you doing this on an ereader, Windows folder, Apple...?  
  > **username_3**: @username_2 that would best executed through a Linux terminal. A good reference: ["How do I install Pdftk on my server?"](http://stackoverflow.com/questions/3146766/how-do-i-install-pdftk-on-my-server) there is a graphical tool: [PDFtk Free](http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/)  
  > **username_4**: @Gramps You can use it on Windows as well, and on [OSX](http://stackoverflow.com/questions/20804441/how-do-i-installing-pdftk-on-mac)  
  > **username_5**: Really like this strategy... I've been having a time trying to merge several hundred html files into a single epub. Calibre's `ebook-convert` lets me do this for a 1:1 conversion but doesn't seem to accept multiple input files. There is Calibre Merger Plugin but it appears to only work for graphical mode making it a no-go for scripting ~800 html pages into a single file... With this, I can programmatically convert html to pdf (via `ebook-convert`), merge multiple pdfs into one with the above, and then convert the final pdf back to epub with one more `ebook-convert` call.  
  
  ---
  
  ### Answer by username_6 on 2014-04-30. Score: 0
  
  You can use **Calibre Merger Plugin** , I think.
  
  For details, click to [***how-to-merge-multiple-epub-ebooks***](http://www.epubor.com/how-to-merge-multiple-epub-ebooks.html)
  
  > **Comments:**
  > **username_7**: Ideally you should summarize the steps in your answer (and leave the link). Link-only answers are generally frowned up (especially if the site is username_7 or the link dies for whatever reason).  
  
  ---
  
  