It happens a lot that I want to send a sequence of HTML pages from a website, all together in a unique file so that I can read it in my e-reader.

For instance this online resource can be converted to a sequence of pdf files.

I don't have any limitation in OS (Linux or Windows) and both paid and gratis solutions are fine. An online solution (a web site that converts whatever URLs you pass in) is the best.

  • Calibre does something like that, using a concept called "Recipes". No need for LaTeX with that. While I'm using Calibre for my eBooks (EPUB/MOBI), I've never used it for bundling a website as PDF, so I cannot say how well it works (hence a comment and not an answer).
    – Izzy
    Mar 6, 2016 at 12:11
  • My question is how did they made the pdf I put as sample inside the question? What I like about it is when you click on a link, it will jump to a corresponding part in PDF and it doesn't open the browser.
    – Sadegh
    Mar 7, 2016 at 11:08
  • Any good converter should do that. I cannot tell you about the "how" (which would go a bit too far for this site, as it's rather a development question).
    – Izzy
    Mar 7, 2016 at 11:12
  • Is the "how" part is something similar to this example written in python? It inspects html code of initial page,downloads it, find the link for next page and do the previous step until it cannot download the page any more.
    – Sadegh
    Mar 7, 2016 at 11:18

1 Answer 1


Pandoc can take one or more web pages and convert them to a number of formats including EPUB and pdf but for pdf you will also need a latex processor such as MiKTeX.


1: Download the make manual and convert it to pdf:

pandoc -s -r html http://www.gnu.org/software/make/ -o make_manual.pdf

2: Download both the make and awk manuals and combine them into an epub:

pandoc -s -r html http://www.gnu.org/software/make/ http://www.gnu.org/software/gawk/manual/gawk.html -o make_awk_man.epub

pandoc is:

  • Free, Gratis & Open Source
  • Cross Platform Linux, OS-X & Windows
  • Able to read, from any accessible source including online:
    • commonmark, docbook, docx, epub, haddock, html, its own json, latex,
    • markdown, markdown_github, markdown_mmd, markdown_phpextra,
    • markdown_strict, mediawiki, native, odt, opml, org, rst, t2t,
    • textile, twiki
  • Able to write:
    • asciidoc, beamer, commonmark, context, docbook, docx, dokuwiki,
    • dzslides, epub, epub3, fb2, haddock, html, html5, icml, json,
    • latex, man, markdown, markdown_github, markdown_mmd,
    • markdown_phpextra, markdown_strict, mediawiki, native, odt,
    • opendocument, opml, org, pdf with latex processor, plain, revealjs, rst, rtf, s5,
    • slideous, slidy, texinfo, textile
  • Does not need word installed to generate docx, etc.

You will find that sometime the output display and layout do not exactly match the original - especially if the original uses unusual fonts that are not installed on your system that are only displayed in your browser.

DANGER Once you start using pandoc it is hard to stop.

  • Thanks Steve, pandoc looks an interesting program. Is it possible to give pandoc sequence of html pages (lets say a txt file that contains list of html pages) and it convert all of them in a unique pdf? or maybe I should convert each pdf seperately and combine all of them at the end? Another question: what I like about pdf I sent inside my question is that all hyperlinks are converted to hyperlinks working inside the pdf, so that if you click on link it will jump to corresponding part in pdf. Can pandoc do this?
    – Sadegh
    Mar 7, 2016 at 11:06
  • Yes you can give it a sequence of html files and it can package all of the files into one pdf or epub and internal and external links are preserved although I have not tried it with multiple inputs - you can pipe a file with a list of sources but I don't think that you can read from an input list file by default. N.B. it cannot convert read pdfs so if you wished to assemble later you would need to use markdown or something rather than pdf as in intermediate. Mar 7, 2016 at 15:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.