PDF generation with Clojure?

836 views
Skip to first unread message

Jim Tittsler

unread,
May 24, 2010, 6:22:01 PM5/24/10
to clo...@googlegroups.com
Is there a library for generating PDF pages/reports with Clojure? (Or
a Java library that interoperates more naturally than others?)

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Quzanti

unread,
May 25, 2010, 8:47:13 AM5/25/10
to Clojure
I am not enough of a functional programming / Clojure expert to
comment on which library would integrate best with Clojure.

However I have always found iText to be badly designed (even though
historically it has been the mindshare leader with most features)

Also the licence on iText is GPL 3 with Affero extension, but the
iText guy has sold the commercial rights to a company so anything
could happen with it

http://itextpdf.com/contact.php

I am hopeful that Apache PdfBox (recently out of incubation) will
become the main Java library. It has historically been viewed as
having a better design, and has always been better if you want to do
the complex task of reading (parsing) pdf documents rather than just
generating them (this is a tough problem because a pdf document is
just glyphs)

If it gets more heavily used as catches up on the pdf generation
features then PdfBox will be a no-brainer.

All Java libraries will be closely tied to the Adobe Pdf spec/api so

(1) They won't differ that much
(2) If any part of the Adobe spec isn't implemented it will be quite
easy to do yourself as you will effectively just be wrapping a call

hth,

Base

unread,
May 25, 2010, 9:55:25 AM5/25/10
to Clojure
There are several libraries that I have heard of. Here is a list of
several.

http://java-source.net/open-source/pdf-libraries

I have only tried out iText and FOP with mixed results.



On May 24, 5:22 pm, Jim Tittsler <j...@onjapan.net> wrote:
> Is there a library for generating PDF pages/reports with Clojure?  (Or
> a Java library that interoperates more naturally than others?)
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.To post to this group, send email tocl...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your first post.
> To unsubscribe from this group, send email toclojure+...@googlegroups.com

Mark Derricutt

unread,
Jun 8, 2010, 11:01:31 PM6/8/10
to clo...@googlegroups.com
We use flying saucer/itext , an example of this from clojure can be seen on my blog at:


This is some old clojure code and is quite nasty, but its only really the last 5 lines you need for the flying saucer stuff.

This does XHTML+CSS->PDF.

--
Pull me down under...

Peter Thatcher

unread,
Jun 9, 2010, 10:35:51 AM6/9/10
to Clojure
Just recently, I had a little hobby project to make PDFs for printing
little vocabulary books for kids. I used Clojure to output Latex,
which then produced the PDFs. I might do a blog post about it to
give you more details.

Clojure worked great, and I was glad I used it. The only problem is
that you have to know Latex :).

Martin DeMello

unread,
Jun 9, 2010, 5:46:30 PM6/9/10
to clo...@googlegroups.com
On Wed, Jun 9, 2010 at 8:05 PM, Peter Thatcher <ptha...@gmail.com> wrote:
> Just recently, I had a little hobby project to make PDFs for printing
> little vocabulary books for kids.   I used Clojure to output Latex,
> which then produced the PDFs.   I might do a blog post about it to
> give you more details.
>
> Clojure worked great, and I was glad I used it.  The only problem is
> that you have to know Latex :).

I've done this using ruby -> lout -> ps -> pdf. The advantage of lout
is that machine generation was one of its design goals from the
outset, so it's a lot easier to work with than latex.

martin

Moritz Ulrich

unread,
Jun 9, 2010, 5:52:23 PM6/9/10
to clo...@googlegroups.com
For simple things like lists, I like to use org-mode files as a
intermediate format. Emacs then generates .tex and pdflatex .pdf for
me :)

> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

--
Moritz Ulrich
Programmer, Student, Almost normal Guy

http://www.google.com/profiles/ulrich.moritz

soyrochus

unread,
Jun 10, 2010, 4:26:33 AM6/10/10
to Clojure
I am using Clojure to prototype integration of JasperReports in
Spring. That works very well.

JasperReports is a quite capable report generator/library (Open Source
with commercial support) which allows for the generation of pdf, MS
Office ((MS Word, Excel, Powerpoint) and Open Office documents etc.

http://jasperforge.org/projects/jasperreports

Look at iReport for a GUI report designer

http://jasperforge.org/projects/ireport

Quite useful could be DynamicJasper, which is an Open Source third-
party library "on top of" JsperReports which helps in the dynamic
generation of reports as well as a series of common tasks like
generating concatenated reports.

http://dynamicjasper.sourceforge.net/

Good luck,

Iwan
Reply all
Reply to author
Forward
0 new messages