Simple Clojure wrapper for Open HTML to PDF
Go to file
2017-04-01 14:58:23 -04:00
src/clj_htmltopdf initial commit 2017-04-01 14:58:23 -04:00
.gitignore initial commit 2017-04-01 14:58:23 -04:00
LICENSE initial commit 2017-04-01 14:58:23 -04:00
project.clj initial commit 2017-04-01 14:58:23 -04:00
README.md initial commit 2017-04-01 14:58:23 -04:00

clj-htmltopdf

A light-weight wrapper for the Open HTML to PDF library to make it a little bit easier to use directly from Clojure.

Leiningen

[clj-htmltopdf "0.1"]

Usage

(use 'clj-htmltopdf.core)

(->pdf
  [:div
    [:h1 "HTML to PDF"]
    [:p "Glorious!"]]
  "output.pdf")

clj-htmltopdf.core/->pdf can take a variety of different input and output argument types, such as strings, java.io.File objects, java.net.URL objects, streams, etc.

As shown in the above example, a special case is made when the input argument is Hiccup-style HTML where it will be automatically converted to an HTML string before being rendered as a PDF.

License

Copyright © 2017 Gered King

Distributed under the LGPL3 license.