Apache::AxKit::Language::HtmlDoc - deliver XHTML as PDF


Apache::AxKit::Language::HtmlDoc - deliver XHTML as PDF


  AxAddStyleMap text/xhtml Apache::AxKit::Language::HtmlDoc
  # as last step in your processor chain, add:
  AxAddProcessor text/xhtml NULL

  # want custom HTMLDOC args? here we go:
  PerlAddVar AxHtmlDocOptions --linkcolor '#ff0000' --linkstyle plain


Go and get HTMLDOC (http://www.easysw.com/htmldoc/) first, then you can convert any XHTML page into a quite nice looking PDF document. Be prepared to do some tweaking of your xhtml input, though, because HTMLDOC is HTML 3.2 only, it does not yet understand CSS and only some HTML 4.0 (as of version 1.8.18). Using an extra XSLT stylesheet, it isn't all that hard to create HTMLDOC friendly input and you get nice results.

You should not use this for mostly hand-crafted PDFs, for that see the PassiveTeX module, which converts XSL:FO to PDF. HTMLDOC has its quirks, sometimes it is a bit frustrating getting the output right. It pays off if you have lots of existing (or generated) HTML and want all of them to be PDF, but for a custom PDF like a bill, you have much better control with PassiveTeX.


Jörg Walter, jwalt@cpan.org

 Apache::AxKit::Language::HtmlDoc - deliver XHTML as PDF