Liking cljdoc? Tell your friends :D

pdf-stamper

Combine JSON template description with PDF template files and input data to form a complete PDF.

Stability

This project is being used in production by Ingenium Golf, and has been since its inception, so it is pretty stable by now. Active development is happening mostly in branches, and only when I can find the time (or it intersects with the needs of Ingenium Golf).

Usage

Not much to see here yet. Library is still under active development.

Feeling adventurous? The library is on Clojars:

Clojars Project

Example: Template format

To give a quick example of how a PDF template description could look, this is an example of a template with a single hole:

{:name :template-one-hole
 :holes {:even [{:height 10.0
                 :width 10.0
                 :x 1.09
                 :y 3.12
                 :name :lonely-hole
                 :type :image
                 :priority 10}]
         :odd [{:height 10.0
                :width 10.0
                :x 1.09
                :y 3.12
                :name :lonely-hole
                :type :image
                :priority 10}]}}

It describes a hole on an actual PDF document page, where data (in this case an image) should be inserted. The data that makes pdf-stamper use the hole could look like:

{:template :template-one-hole
 :locations [{:lonely-hole {:contents {:image (java.io.BufferedImage. "an-image.jpg")}}}]}

See Documentation for further details.

Documentation

Documentation for both users and developers of pdf-stamper can be found in the Marginalia docs. Users can safely skip the documentation for pdf-stamper.text.parsed and pdf-stamper.text.pdfbox.

The documentation always describes the latest stable release; to generate the docs for a snapshot release, run lein marg.

Future

First:

  • Tests!

After that, in no particular order:

  • Hyphenation support
  • Text align for parsed text (always left-aligned now)
  • Control indentation of first line for parsed text
  • Add space after every line of paragraph
  • Pluggable text parser, to support other formats than XML (is this even relevant?)

Acknowledgments

  • Ingenium Golf (for letting me work on this)

License

Copyright © 2014-2018 Matthias Diehn Ingesman

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close