Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Here's the problem: There's a website that I often need for reference and I would like an offline version that also works in mobile devices, a PDF comes to mind.

I can make an offline copy of the HTML version with wget, that's not a the problem.

What I'd really like is a way to transform all the HTML pages into a single PDF with the internal links still working. So, a link that would have referred to another URL on the web version should then refer to the corresponding page in the PDF.

Ideally there should also be a way to generate a table of content to put into the PDF.

How can I achieve this?

Bash/Python/ruby/whatever scripts and other command line stuff are welcome, too.

(I'm on OSX 10.9 by the way.)

share|improve this question
    
PDF on mobile devices are pretty horrible in my opinion. You may be a whole lot better off keeping it in the HTML format that you get from wget as properly created HTML will automatically resize gracefully to the screen. If it is still keeping the full size, then it will be the same with PDF, you'd be stuck on that screen size while working on a tiny screen. –  Darius Nov 8 '13 at 11:42
    
A PDF will be just fine in this case since it's going to be read mostly on an iPad. ePub would also be fine, though. Anything that can be loaded into the iBooks app. –  lnwdr Nov 8 '13 at 12:02
    
I still have issues with PDF on iBook but I guess that is personal opinion. Not sure how to transfer HTML into iPad readable format but the closest thing to do offline pages reading is using an App called "Pocket" (was Read it Later) but I am not sure if they do the whole website, but they do pages. –  Darius Nov 8 '13 at 12:14
    
No, Pocket or Instapaper are only for single pages. I need a whole site with lots of pages. –  lnwdr Nov 8 '13 at 12:28
1  
Did you look at Calibre or Sigil. See here. I haven't tried but Calibre should be able to make an eBook from multiple Htmls if they are linked. –  Rik Nov 8 '13 at 12:54
add comment

1 Answer

up vote 1 down vote accepted

You should take a look at wkhtmltopdf, a free tool which, judging from the list of advanced features advertised in its manual page, should at least roughly satisfy you:

Printing more then one HTML document into a PDF file.

Running without an X11 server.

Adding a document outline to the PDF file.

Adding headers and footers to the PDF file.

Generating a table of contents.

Adding links in the generated PDF file.

Printing using the screen media-type.

Disabling the smart shrink feature of webkit.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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