Simple Clojure wrapper for Open HTML to PDF
Go to file
Gered 983753c859 fix css unit tests consistency
sort map attribute keys before generating style string so they always
get generated in the same way
2017-04-02 16:09:47 -04:00
resources improve base css style support / options. add custom font support 2017-04-02 15:16:48 -04:00
src/clj_htmltopdf fix css unit tests consistency 2017-04-02 16:09:47 -04:00
test/clj_htmltopdf/test fix css unit tests consistency 2017-04-02 16:09:47 -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 add css stylesheet string generation functionality 2017-04-01 18:24:34 -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.