incubator-odf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Devin Han <>
Subject Fwd: Create new FOP project to create PDF document with Java code (not with XSL-FO).
Date Mon, 07 Nov 2011 05:14:33 GMT
Hi All,

Angelo zerr is working on ODT 2 XHTML via ODFDOM and ODT 2 PDF via
ITEXT+ODFDOM. He is willing to contribute his code back to ODF Toolkit.
Thanks Angelo zerr. This is a good thing, as lots of users hope ODF Toolkit
can supply some convertors to do odf->html, odf -> pdf, etc.

Any guys interested in his work? Or can supply help on the layout issue?

---------- Forwarded message ----------
From: Angelo zerr <>
Date: 2011/11/5
Subject: Create new FOP project to create PDF document with Java code (not
with XSL-FO).
To:,, Devin
Han <>, Pascal Leclercq <>


At first I introduce to me. I'm XDocReport commiter. This project gives you the
capability to create model with OpenOffice (odt) or MS word (docx) with
Freemarker, Velocity syntax and generate report (odt 2 odt, docx 2 docx)
But it's possible too to convert it the generated report to another format
like PDF, XHTML....

We have implemented several ODT and Docx converter (ODT 2 PDF via FOP (with
XSL-FO)..),  ODT 2 PDF via IText by using ODFDOM, Docx 2 PDF via IText by
using HWPF POI). There is onlide demo of XDocReport.
For instance

1) Convert ODT 2 XHTML via ODFDOM : please see at
2) Convert ODT 2 PDF via ITEXT+ODFDOM : please see at
is very bad, I'm
working about that).

I would like give my code to Apache but the big problem is the iText
We are using iText, because you can create a PDF with Java model, that is
more easy than XSL-FO. I have already done
odt -> xslt -> FO -> FOP -> PDF and docx -> xslt -> FO -> FOP -> PDF
developing XSL is very awfull compared to developing Java code. More in the
case of docx and odt, styles must be computed and even with xsl:key,
performance are not very good.

So I'm searching a solution like iText to create PDF with Java code. After
several discussion in the PDFBox forum with Jeremias Maerki, he tell me
that it's possible to create PDF with FOP with Java code

The only problem is layout management. My idea is to create a new project
based on FOP to create PDF with Java code (by managing layout) like iText.

StructuredDocument document = new StructuredDocument();
Paragraph paragraph = new Paragraph();
paragraph.addRun(new Run("AAAA"));

paragraph = new Paragraph();
paragraph.addRun(new Run("AAAA"));
paragraph.addRun(new Run("BBBB"));

After that, we could use this API to convert docx ->PDF like this docx ->
HWPF POI -> FOP Java code -> PDF and odt ->PDF like this odt -> ODFDOM ->
FOP Java code -> PDF.

Are you interested to help us to create this project? Devin Han who is one
of lead (I believe) of ODF Toolkit is very interested to have ODT -> PDF
converter and he wants to contribute to this project.

For the layout, I'm not an expert but I have discovered that Java provides
some layout like java.awt.font.TextLayout. Do you think it's a good idea to
use it? Or do yout think it's better to create our own layout manager?

Thank a lot for your answer.

Regards Angelo


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message