[racket] html -> pdf?

From: Jordan Schatz (jordan at noionlabs.com)
Date: Wed Sep 26 11:51:10 EDT 2012

> 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.

Racket would be preferred, but not required. It looks like using wkhtmltopdf
http://code.google.com/p/wkhtmltopdf/ or CutyCapt
http://cutycapt.sourceforge.net/ will be the most straightforward. CutyCapt
seems to do the best job "out of the box", but isn't maintained anymore, and
unfortunately it looks like they both require an xserver to be running. 

The intent is to create "hard copy" PDF from content marked up in html and CSS,
since html+css is nicer to work with then PS / PDF, and since I already have the
content in HTML form...

Thanks,
Jordan

On Tue, 25 Sep 2012 14:16:34 -0500, Carson Chittom <carson at wistly.net> wrote:
> 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.
> 
> 
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.