Answers.Body: <p>Let me tell you the easiest way: you could paste the entire contents from the browser into a MS word/Libre Office file and then export to PDF. Both programs are fairly good at importing HTML -- they are just lousy at exporting to HTML. If you made sure that all H1 titles were mapped to a single style in the office program, you could either generate a TOC at the top or permit an outline view inside the PDF. It's unlikely that any of the original HTML links will work though. </p>
  
  <p>There are other ways to do it -- using GUI tools like Calibre or Sigil. You could also try the <a href="https://wkhtmltopdf.org/index.html" rel="nofollow noreferrer">open source WKHTMLTOPDF</a>  (which I haven't tried yet). </p>
  
  <p><strong>UPDATE:</strong> I just looked at the content you are trying to store. This is structured technical reference material; probably not a good candidate for the cut and paste solution I recommended and not good viewing for PDF. You probably need to store the html files on your device so that an app like Android's <a href="https://play.google.com/store/apps/details?id=it.nikodroid.offline&amp;hl=en" rel="nofollow noreferrer">Offline Browser</a> can view it. I just tried viewing <a href="http://en.cppreference.com/w/" rel="nofollow noreferrer">your web URL</a> in Offline browser, and it probably is what you're looking for. It stores in offline mode on your android device the site, with lots of ways to configure it (depth of links, number of links, etc). </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-12T20:24:03.300Z
Answers.LastActivityDate: 2017-08-12T20:24:03.300Z
Answers.UserDisplayName: idiotprogrammer
Answers.Body: <p>Let me introduce you to a service (with a free option) that I'm just investigating myself.  Please note that I am NOT an employee of this company, nor a reseller, nor in anyway affiliated with them.  I'm just passing along a resource I discovered that has the potential of being really, really, really valuable (though not really, really, really tested yet.  I'm working on that).</p>
  
  <p><a href="http://cloudconvert.com" rel="nofollow noreferrer">http://cloudconvert.com</a></p>
  
  <p>These folks convert almost anything to anything, including HTML to PDF.  It has an API if you're tring to automate, and a dashboard if you're looking for a one-off.  You do need to sign up to use the service, free or not.  With a free option, it can't hurt to give them a try and see what they can do for you.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-22T10:07:30.667Z
Answers.Text: As with any cloud service **you should never *ever* use this, if your content is, and should stay, private**.
Answers.UserDisplayName: Anthon
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-21T22:43:44.837Z
Answers.LastActivityDate: 2017-08-21T22:43:44.837Z
Answers.UserDisplayName: JBH
Body: <p>Is there some program which can convert a html ebook (consisting of many html files located under different directories and linked to each other) to a pdf file?
  For example, some shell scripting (e.g. in bash) which calls some program that does the conversion? </p>
  
  <p>Additionally, if possible, can the resulting pdf file  have outlines/bookmarks for clicking and jumping, according to the structures of the html book?</p>
  
  <p>An example of a html ebook can be downloaded from <a href="http://en.cppreference.com/w/Cppreference:Archives" rel="nofollow noreferrer">http://en.cppreference.com/w/Cppreference:Archives</a>. Extract it, and there are several levels of subdirectories. At the root level, there is a file <code>cppreference-doxygen-local.tag.xml</code> which seems to list all the html files, and might be helpful for convertion to a pdf file.</p>
  
  <p>Thanks.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-13T14:25:55.453Z
Comments.Text: You can take a look here http://www.princexml.com
Comments.UserDisplayName: maxwell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-13T14:26:57.663Z
Comments.Text: Seems like converting these manuscripts programmatically is a req. from the bash reference
Comments.UserDisplayName: maxwell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-13T14:57:04.217Z
Comments.Text: Thanks. What do you mean by "a req from the bash reference"?
Comments.UserDisplayName: Tim
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-13T14:57:49.673Z
Comments.Text: A requirement to an adequate solution
Comments.UserDisplayName: maxwell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-13T14:58:18.970Z
Comments.Text: What is "a req. from the bash reference" then?
Comments.UserDisplayName: Tim
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-16T18:38:41.623Z
Comments.Text: Why do you want to end up with a PDF that won't wrap text to different screen sizes? If you really want this, look at [Pandoc](http://www.pandoc.org). It can read html and "It can also produce PDF output on systems where LaTeX, ConTeXt, or wkhtmltopdf is installed." Pandoc runs on several operating systems.
Comments.UserDisplayName: Bulrush
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-16T18:55:30.483Z
Comments.Text: @Bulrush  because I don't know how to add notes, comments, highlight, underline on html. I know some software that can do that on pdf files.
Comments.UserDisplayName: Tim
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-17T09:33:56.587Z
Comments.Text: Ah, so you need to highlight some stuff in the PDF and add notes?
Comments.UserDisplayName: Bulrush
Tags: <pdf><conversion><html>
Title: How to convert a html ebook to a pdf file?
UserDisplayName: Tim
ThreadText: # How to convert a html ebook to a pdf file?
  
  (Asked by: username_0 on 2017-08-12)
  
  Is there some program which can convert a html ebook (consisting of many html files located under different directories and linked to each other) to a pdf file?
  For example, some shell scripting (e.g. in bash) which calls some program that does the conversion?
  
  Additionally, if possible, can the resulting pdf file have outlines/bookmarks for clicking and jumping, according to the structures of the html book?
  
  An example of a html ebook can be downloaded from <http://en.cppreference.com/w/Cppreference:Archives>. Extract it, and there are several levels of subdirectories. At the root level, there is a file `cppreference-doxygen-local.tag.xml` which seems to list all the html files, and might be helpful for convertion to a pdf file.
  
  Thanks.
  
  **Tags:** pdf, conversion, html
  
  > **Comments:**
  > **username_1**: You can take a look here http://www.princexml.com  
  > **username_1**: Seems like converting these manuscripts programmatically is a req. from the bash reference  
  > **username_0**: Thanks. What do you mean by "a req from the bash reference"?  
  > **username_1**: A requirement to an adequate solution  
  > **username_0**: What is "a req. from the bash reference" then?  
  > **username_2**: Why do you want to end up with a PDF that won't wrap text to different screen sizes? If you really want this, look at [Pandoc](http://www.pandoc.org). It can read html and "It can also produce PDF output on systems where LaTeX, ConTeXt, or wkhtmltopdf is installed." Pandoc runs on several operating systems.  
  > **username_0**: @username_2  because I don't know how to add notes, comments, highlight, underline on html. I know some software that can do that on pdf files.  
  > **username_2**: Ah, so you need to highlight some stuff in the PDF and add notes?  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2017-08-12. Score: 2
  
  Let me tell you the easiest way: you could paste the entire contents from the browser into a MS word/Libre Office file and then export to PDF. Both programs are fairly good at importing HTML -- they are just lousy at exporting to HTML. If you made sure that all H1 titles were mapped to a single style in the office program, you could either generate a TOC at the top or permit an outline view inside the PDF. It's unlikely that any of the original HTML links will work though.
  
  There are other ways to do it -- using GUI tools like Calibre or Sigil. You could also try the [open source WKHTMLTOPDF](https://wkhtmltopdf.org/index.html) (which I haven't tried yet).
  
  **UPDATE:** I just looked at the content you are trying to store. This is structured technical reference material; probably not a good candidate for the cut and paste solution I recommended and not good viewing for PDF. You probably need to store the html files on your device so that an app like Android's [Offline Browser](https://play.google.com/store/apps/details?id=it.nikodroid.offline&hl=en) can view it. I just tried viewing [your web URL](http://en.cppreference.com/w/) in Offline browser, and it probably is what you're looking for. It stores in offline mode on your android device the site, with lots of ways to configure it (depth of links, number of links, etc).
  
  
  ---
  
  ### Answer by username_4 on 2017-08-21. Score: 1
  
  Let me introduce you to a service (with a free option) that I'm just investigating myself. Please note that I am NOT an employee of this company, nor a reseller, nor in anyway affiliated with them. I'm just passing along a resource I discovered that has the potential of being really, really, really valuable (though not really, really, really tested yet. I'm working on that).
  
  <http://cloudconvert.com>
  
  These folks convert almost anything to anything, including HTML to PDF. It has an API if you're tring to automate, and a dashboard if you're looking for a one-off. You do need to sign up to use the service, free or not. With a free option, it can't hurt to give them a try and see what they can do for you.
  
  > **Comments:**
  > **username_5**: As with any cloud service **you should never *ever* use this, if your content is, and should stay, private**.  
  
  ---
  
  