Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to read and annotate internet articles like books on my iPad so I would like to convert HTML to PDF. Is there a way of doing this that

  • preserves every font as is
  • can make PDF out of selection
  • handle javascript source code highlighting libraries well
  • doesn't add anything (ads from shareware or logos etc) to every page

I will be happy with any solution applicable to iPad or OSX. I have tried some converters I have found online but none fit the criteria above.

share|improve this question
up vote 0 down vote accepted

You don't have to use extra programs always if you have Google Chrome. In google chrome open the HTML file, then Go Settings-->Print and then printing page will be opened. On this page click "Change" button which is next to destination section and then select "Save as a PDF" --> OK Then "print" button will turn into "save" button. Now press the save button and save your HTML file as a PDF. [ For online web pages it's very very usefull for example if you fill form on the web page your form informations will be appeared on the pdf file.] Enjoy!

share|improve this answer

One possibility would be to use wkhtmltopdf:

Simple shell utility to convert html to pdf using the webkit rendering engine, and qt.

Given a directory that contains HTML files, you could run this from a terminal:

for i in *html; do wkhtmltopdf $i $i.pdf; done

Not sure what you mean about javascript. If you want to make pdfs with code highlighting of the actual source code (without rendering the HTML), see my answer here. I also don't know what you mean by "make PDF out of selection".

share|improve this answer
See this article:… it highlights the example codes, with a nice, green background, but even wkhtmltopdf don't fully render the page either, so it doesn't convert the colors :( and all I got is a black and white pdf with pictures – kissgyorgy Jun 27 '13 at 1:19
@Walkman You may want to go to the previous release of wkhtmltopdf. IIRC, there were some issues with the latest on up there, especially related to the graphics. – jszakmeister Jun 27 '13 at 1:27
@Walkman I get pretty good results as long as I specify the CSS style sheet. I saved the link you posted as "foo.html" and its assiciated files in "foo_files", then ran wkhtmltopdf --user-style-sheet foo_files/screen.css foo.html foo.pdf and got this pdf which has colors and syntax highlighting. – terdon Jun 27 '13 at 1:37
@jszakmeister THIS IS (almost) PERFECT thank you! I downloaded the version 0.10.0_rc2 and this renders the page nicely, even with colors, without any other option. – kissgyorgy Jun 27 '13 at 1:43
Now I only have to figure it out how to convert only part of the page? for example the main article without any clutter – kissgyorgy Jun 27 '13 at 1:44

You can use evernote web clipper plugin for chrome, to save web pages as PDF and they will be instantly available in your evernote account. Or you can use Pocket which is a wonderful read it later service. Although it wont allow you to save pages as PDF but it converts web pages in easy to read article format, and you can read them using its iPhone, iPad, android or chrome app.

share|improve this answer
I can't seem to save the selected area as PDF (greyed out) did you mean this funcionality? The whole point is annotation on a tablet, which you can't do with either Pocket or Evernote. – kissgyorgy Jun 27 '13 at 3:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .