[racket] html -> pdf?

From: Carson Chittom (carson at wistly.net)
Date: Tue Sep 25 15:24:07 EDT 2012

Carson Chittom <carson at wistly.net> writes:

> Jordan Schatz <jordan at noionlabs.com> writes:
>
>> Is anyone aware of a way to take arbitrary html pages and turn them into pdfs?
>>
>> At the moment it looks like I would need to write Racket bindings for a html
>> rendering engine (WebKit or Gecko), render the page, capture the output as a
>> bitmap and embed it in a PDF... but that sounds like the long way around.
>
> Dumb question: does it have to involve Racket?  Googling for "html 2
> pdf" and "html to pdf converter" turned up a lot of hits--most of them
> involving PHP and Ghostscript.
>
> If you're looking at PDF-as-an-alternative-to-hardcopy (as opposed to a
> "real" PDF document) on Windows PDFCreator works pretty well, adding a
> PDF "printer."  On OS X, of course, the same functionality is built-in.

I forgot to say--since your mail client's User-Agent header indicates
you posted to the list from a Linux machine--that HTMLDOC[1] is also
available; but I doubt that it would fit your (or anyone's in 2012)
needs, since it only "supports most HTML 3.2 elements, some HTML 4.0
elements, and can generate title and table of contents pages. It does
not currently support stylesheets."[2]

[1] html://www.htmldoc.org
[2] http://www.htmldoc.org/documentation.php/Introduction.html


Posted on the users mailing list.