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.

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
add comment

2 Answers 2

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: blueprintforge.com/blog/2012/01/24/… 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 –  Walkman Jun 27 '13 at 1:19
1  
@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. –  Walkman 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 –  Walkman Jun 27 '13 at 1:44
show 2 more comments

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. –  Walkman Jun 27 '13 at 3:18
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.